]> git.ipfire.org Git - thirdparty/git.git/commitdiff
download_https_uri_to_file(): do not leak fd upon failure
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 5 Jul 2026 08:24:20 +0000 (08:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 5 Jul 2026 16:12:09 +0000 (09:12 -0700)
When the `git-remote-https` command fails, we do not want to leak
`child_out`.

Pointed out by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bundle-uri.c

index 3b2e347288c3b73a5e1aad63154ba754e3c0b833..34fa452e76090516aae89ca59493705c6751ca94 100644 (file)
@@ -378,7 +378,7 @@ cleanup:
        if (child_in)
                fclose(child_in);
        if (finish_command(&cp))
-               return 1;
+               result = 1;
        if (child_out)
                fclose(child_out);
        return result;