When CURLOPT_POSTFIELDS is called more than once on the same
curl handle, php/curl did not free the memory of the previous
post data. This commit will fix the problem unless the curl
handle was previously duplicated using the curl_copy_handle()
function in which case we can not know if the post data is
still in use or not by any curl handle
- cURL extension:
. Fixed bug (segfault due to libcurl connection caching). (Pierrick)
+ . Fixed bug #63859 (Memory leak when reusing curl-handle). (Pierrick)
. Fixed bug #63795 (CURL >= 7.28.0 no longer support value 1 for
CURLOPT_SSL_VERIFYHOST). (Pierrick)
. Fixed bug #63352 (Can't enable hostname validation when using curl stream
return 1;
}
+ if (Z_REFCOUNT_P(ch->clone) <= 1) {
+ zend_llist_clean(&ch->to_free->post);
+ }
zend_llist_add_element(&ch->to_free->post, &first);
error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first);