curl/curl-7.19.4-easy-leak.patch

37 lines
1.1 KiB
Diff
Raw Normal View History

diff -up curl-7.19.4/lib/easy.c.easy-leak curl-7.19.4/lib/easy.c
--- curl-7.19.4/lib/easy.c.easy-leak 2009-01-29 21:41:51.000000000 +0100
+++ curl-7.19.4/lib/easy.c 2009-03-03 07:54:58.000000000 +0100
@@ -352,13 +352,11 @@ CURL *curl_easy_init(void)
struct SessionHandle *data;
/* Make sure we inited the global SSL stuff */
- if(!initialized) {
- res = curl_global_init(CURL_GLOBAL_DEFAULT);
- if(res) {
- /* something in the global init failed, return nothing */
- DEBUGF(fprintf(stderr, "Error: curl_global_init failed\n"));
- return NULL;
- }
+ res = curl_global_init(CURL_GLOBAL_DEFAULT);
+ if(res) {
+ /* something in the global init failed, return nothing */
+ DEBUGF(fprintf(stderr, "Error: curl_global_init failed\n"));
+ return NULL;
}
/* We use curl_open() with undefined URL so far */
@@ -549,10 +547,10 @@ void curl_easy_cleanup(CURL *curl)
{
struct SessionHandle *data = (struct SessionHandle *)curl;
- if(!data)
- return;
+ if(data)
+ Curl_close(data);
- Curl_close(data);
+ curl_global_cleanup();
}
/*