{"thread":{"id":"7894","subject":"[PATCH] http.c: Fix problem with repeated calls of http_init","startedAt":"2007-04-29T02:46:42Z","lastAt":"2007-04-29T02:46:42Z","messageCount":1,"participants":["Julian Phillips"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"40686","messageId":"20070429025059.2315.98407.julian@quantumfyre.co.uk","threadId":"7894","inReplyTo":null,"subject":"[PATCH] http.c: Fix problem with repeated calls of http_init","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2007-04-29T02:46:42Z","receivedAt":"2007-04-29T02:46:42Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"Calling http_init after calling http_cleanup causes a segfault.  This\nis due to the pragma_header curl_slist being freed but not being set\nto NULL.  The subsequent call to http_init tries to setup the slist\nagain, but it now points to an invalid memory location.\n\nSigned-off-by: Julian Phillips <julian@quantumfyre.co.uk>\n---\n\nThis doesn't cause any problems in current git as far as I know.  It does however break my C fetch when using http.\n\n http.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex 576740f..ae27e0c 100644\n--- a/http.c\n+++ b/http.c\n@@ -300,6 +300,7 @@ void http_cleanup(void)\n \tcurl_global_cleanup();\n \n \tcurl_slist_free_all(pragma_header);\n+        pragma_header = NULL;\n }\n \n struct active_request_slot *get_active_slot(void)\n-- \n1.5.1.2\n"}]}