Thread (40 messages) 40 messages, 5 authors, 19h ago
HOTtoday

[PATCH 03/13] download_https_uri_to_file(): do not leak fd upon failure

From: Johannes Schindelin via GitGitGadget <hidden>
Date: 2026-07-01 07:04:39
Subsystem: the rest · Maintainer: Linus Torvalds

From: Johannes Schindelin <redacted>

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>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help