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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx>
---

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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]