fix leak
authorMichael Wallner <mike@php.net>
Mon, 9 Feb 2015 10:44:12 +0000 (11:44 +0100)
committerMichael Wallner <mike@php.net>
Mon, 9 Feb 2015 10:44:12 +0000 (11:44 +0100)
php_http_client_curl.c

index 69d01a7719a3293d220ff6c741c641ec86bf4e61..c50779916ff3fc40cf609c03e9ee13d48ffe46b7 100644 (file)
@@ -1506,9 +1506,11 @@ static zval *php_http_curle_get_option(php_http_option_t *opt, HashTable *option
        zval *option;
 
        if ((option = php_http_option_get(opt, options, NULL))) {
-               Z_TRY_ADDREF_P(option);
-               convert_to_explicit_type_ex(option, opt->type);
-               zend_hash_update(&curl->options.cache, opt->name, option);
+               zval zopt;
+
+               ZVAL_DUP(&zopt, option);
+               convert_to_explicit_type(option, opt->type);
+               zend_hash_update(&curl->options.cache, opt->name, &zopt);
        }
        return option;
 }