Skip to content

Commit 8b67981

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Fixed #63859 Memory leak when reusing curl-handle
2 parents 61afb2b + ac3d227 commit 8b67981

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/curl/interface.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,6 +2600,9 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
26002600
return 1;
26012601
}
26022602

2603+
if (Z_REFCOUNT_P(ch->clone) <= 1) {
2604+
zend_llist_clean(&ch->to_free->post);
2605+
}
26032606
zend_llist_add_element(&ch->to_free->post, &first);
26042607
error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first);
26052608

0 commit comments

Comments
 (0)