From e26254575306abbc39acd96c6dc54a07aa3b2aa4 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 9 Feb 2016 11:07:50 +0100 Subject: [PATCH] checkout: fix resource leak --- src/checkout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/checkout.c b/src/checkout.c index a92ad0825..fd8e2c443 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -1487,8 +1487,10 @@ static int blob_content_to_file( if (!data->opts.disable_filters && (error = git_filter_list__load_ext( &fl, data->repo, blob, hint_path, - GIT_FILTER_TO_WORKTREE, &filter_opts))) + GIT_FILTER_TO_WORKTREE, &filter_opts))) { + p_close(fd); return error; + } /* setup the writer */ memset(&writer, 0, sizeof(struct checkout_stream));