fixed memory leak
This commit is contained in:
parent
eaaf939dad
commit
7a45e8b804
14
http.c
14
http.c
|
@ -236,18 +236,9 @@ static void start_fetching(URL_FILE *file)
|
||||||
/* lets start the fetch */
|
/* lets start the fetch */
|
||||||
curl_multi_perform(multi_handle, &file->still_running);
|
curl_multi_perform(multi_handle, &file->still_running);
|
||||||
|
|
||||||
|
/* if still_running is 0 now, we should close the file descriptor */
|
||||||
if (url_feof(file)) {
|
if (url_feof(file)) {
|
||||||
/* if still_running is 0 now, we should return NULL */
|
url_fclose(file);
|
||||||
|
|
||||||
/* make sure the easy handle is not in the multi handle anymore */
|
|
||||||
curl_multi_remove_handle(multi_handle, file->handle);
|
|
||||||
|
|
||||||
/* cleanup */
|
|
||||||
curl_easy_cleanup(file->handle);
|
|
||||||
|
|
||||||
free(file);
|
|
||||||
|
|
||||||
file = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,6 +300,7 @@ CURLMcode url_fclose(URL_FILE *file)
|
||||||
free(file->buffer);/* free any allocated buffer space */
|
free(file->buffer);/* free any allocated buffer space */
|
||||||
free(file->header);
|
free(file->header);
|
||||||
free(file);
|
free(file);
|
||||||
|
file = NULL;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue