summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/curl/interface.c11
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;