]> git.99rst.org Git - git.git/commitdiff
download_https_uri_to_file(): do not leak fd upon failure
authorJohannes Schindelin <redacted>
Sun, 5 Jul 2026 08:24:20 +0000 (08:24 +0000)
committerJunio C Hamano <redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
bundle-uri.c

index 3b2e347288c3b73a5e1aad63154ba754e3c0b833..34fa452e76090516aae89ca59493705c6751ca94 100644 (file)
@@ -378,7 +378,7 @@ static int download_https_uri_to_file(const char *file, const char *uri)
        if (child_in)
                fclose(child_in);
        if (finish_command(&cp))
-               return 1;
+               result = 1;
        if (child_out)
                fclose(child_out);
        return result;
git clone https://git.99rst.org/PROJECT