git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] bundle-url: always close child_out before leaving the function

From
AGAreaZR via GitGitGadget <gitgitgadget@gmail.com>
Date
Dec 18, 2024, 03:32 UTC
Message-ID
<pull.1398.git.git.1734492752951.gitgitgadget@gmail.com>
From: Seija Kijin <doremylover123@gmail.com>
Otherwise, child_out may always be left open
Signed-off-by: Seija Kijin <doremylover123@gmail.com>
---
    bundle-url: always close child_out before leaving the function
    
    Otherwise, child_out may always be left open
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1398%2FAreaZR%2Fbug-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1398/AreaZR/bug-v1
Pull-Request: https://github.com/git/git/pull/1398
 bundle-uri.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bundle-uri.c b/bundle-uri.c
index cdf9e4f9e1d..23dfc1999b5 100644
--- a/bundle-uri.c
+++ b/bundle-uri.c
@@ -337,10 +337,10 @@ static int download_https_uri_to_file(const char *file, const char *uri)
 cleanup:
 	if (child_in)
 		fclose(child_in);
-	if (finish_command(&cp))
-		return 1;
 	if (child_out)
 		fclose(child_out);
+	if (finish_command(&cp))
+		return 1;
 	return result;
 }
 

base-commit: d882f382b3d939d90cfa58d17b17802338f05d66
-- 
gitgitgadget
Message 1 of 1 in “bundle-url: always close child_out before leaving the function”
  1. bundle-url: always close child_out before leaving the functionAreaZR via GitGitGadget, Dec 18, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.