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

[PATCH] http.c: Fix problem with repeated calls of http_init

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Apr 29, 2007, 02:46 UTC
Message-ID
<20070429025059.2315.98407.julian@quantumfyre.co.uk>

Calling http_init after calling http_cleanup causes a segfault. This is due to the pragma_header curl_slist being freed but not being set to NULL. The subsequent call to http_init tries to setup the slist again, but it now points to an invalid memory location.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
---
This doesn't cause any problems in current git as far as I know.  It does however break my C fetch when using http.
 http.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/http.c b/http.c
index 576740f..ae27e0c 100644
--- a/http.c
+++ b/http.c
@@ -300,6 +300,7 @@ void http_cleanup(void)
 	curl_global_cleanup();
 
 	curl_slist_free_all(pragma_header);
+        pragma_header = NULL;
 }
 
 struct active_request_slot *get_active_slot(void)
-- 
1.5.1.2
Message 1 of 1 in “http.c: Fix problem with repeated calls of http_init”
  1. http.c: Fix problem with repeated calls of http_initJulian Phillips, Apr 29, 2007

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.