Skip to content

Commit

Permalink
http.c: Fix problem with repeated calls of http_init
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
qur authored and Junio C Hamano committed Apr 29, 2007
1 parent 4e58bf9 commit e9d54bd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e9d54bd

Please sign in to comment.