the leak is actually from zend_list
[m6w6/ext-http] / php_http_client_curl.c
index 6928945a4ab502ce20eca1661b68feca7fa16641..2e2f87aeaebe61bd8f2706731c23d143ec5b9868 100644 (file)
@@ -341,11 +341,11 @@ static int php_http_curle_dummy_callback(char *data, size_t n, size_t l, void *s
 
 static ZEND_RESULT_CODE php_http_curle_get_info(CURL *ch, HashTable *info)
 {
-       char *c;
-       long l;
-       double d;
-       struct curl_slist *s, *p;
-       zval tmp;
+       char *c = NULL;
+       long l = 0;
+       double d = 0;
+       struct curl_slist *s = NULL, *p = NULL;
+       zval tmp = {{0}};
 
        /* BEGIN::CURLINFO */
        if (CURLE_OK == curl_easy_getinfo(ch, CURLINFO_EFFECTIVE_URL, &c)) {
@@ -1346,7 +1346,7 @@ static void php_http_curle_options_init(php_http_options_t *registry)
                        opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
                        opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_BASEDIR;
 #ifdef PHP_HTTP_CURL_CAINFO
-                       ZVAL_STRING(&opt->defval, PHP_HTTP_CURL_CAINFO);
+                       ZVAL_PSTRING(&opt->defval, PHP_HTTP_CURL_CAINFO);
 #endif
                }
                if ((opt = php_http_option_register(registry, ZEND_STRL("capath"), CURLOPT_CAPATH, IS_STRING))) {