]> git.proxmox.com Git - libgit2.git/commitdiff
checkout: fix resource leak
authorPatrick Steinhardt <ps@pks.im>
Tue, 9 Feb 2016 10:07:50 +0000 (11:07 +0100)
committerPatrick Steinhardt <ps@pks.im>
Tue, 9 Feb 2016 10:09:41 +0000 (11:09 +0100)
src/checkout.c

index a92ad0825e559ad6f7181d52f3c0d9f4eed83328..fd8e2c4435eb2b1d82e0bf512a916030fdaf146d 100644 (file)
@@ -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));