diff options
author | Pierrick Charron <pierrick@php.net> | 2016-07-26 18:50:15 -0400 |
---|---|---|
committer | Pierrick Charron <pierrick@php.net> | 2016-07-26 18:50:15 -0400 |
commit | 24d8f6ed7c583c82d6ed63080d235474f8afec6a (patch) | |
tree | 01988f0a3c988fa9eac93012ad3a7bb7e23421af /ext/curl | |
parent | 64e3e932fc38dc7e59805dfb28acae173503018b (diff) | |
download | php-git-24d8f6ed7c583c82d6ed63080d235474f8afec6a.tar.gz |
Fixed bug #71709
When curl_setopt is called with an empty slist as value, we should
not add the empty slist to the list of slist to free.
Diffstat (limited to 'ext/curl')
-rw-r--r-- | ext/curl/interface.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 7e58c7f1e0..dc4a97197e 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2556,12 +2556,13 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue TSRMLS_DC) } } - if (Z_REFCOUNT_P(ch->clone) <= 1) { - zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL); - } else { - zend_hash_next_index_insert(ch->to_free->slist, &slist, sizeof(struct curl_slist *), NULL); + if (slist) { + if (Z_REFCOUNT_P(ch->clone) <= 1) { + zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL); + } else { + zend_hash_next_index_insert(ch->to_free->slist, &slist, sizeof(struct curl_slist *), NULL); + } } - error = curl_easy_setopt(ch->cp, option, slist); break; |