http.c: Fix problem with repeated calls of http_init
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> Signed-off-by: Junio C Hamano <junkio@cox.net>
Julian Phillips committed
Apr 29, 2007 at 03:46 UTC
e9d54bd18bcf5dc9eb68eb1cba9a6a7ba3f71fd6
1 file changed
+1
http.c
+1
@@ -300,6 +300,7 @@ void http_cleanup(void)
300
curl_global_cleanup();
301
302
curl_slist_free_all(pragma_header);
303
+ pragma_header = NULL;
304
}
305
306
struct active_request_slot *get_active_slot(void)