fix #116: cookies fail with libcurl >= 7.77
[m6w6/ext-http] / src / php_http_client_curl.c
index 89ae5e0bc03bccea4be56653fe0af8dce42e5f5c..0e79f197bd3255cda32398ea4ab0843f55811480 100644 (file)
@@ -856,7 +856,7 @@ static ZEND_RESULT_CODE php_http_curle_option_set_cookiestore(php_http_option_t
        } else {
                storage->cookiestore = NULL;
        }
-       if (    CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore)
+       if (    CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore ? storage->cookiestore : "")
                ||      CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEJAR, storage->cookiestore)
        ) {
                return FAILURE;