[PATCH 03/13] download_https_uri_to_file(): do not leak fd upon failure
- From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jul 1, 2026, 07:04 UTC
- Message-ID
- <a770d9708d806ed6a7334a0db053ad94c51a892e.1782889472.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2163.git.1782889472.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
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> --- bundle-uri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bundle-uri.c b/bundle-uri.c index 3b2e347288..34fa452e76 100644 --- a/bundle-uri.c +++ b/bundle-uri.c @@ -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;
-- gitgitgadget