X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_options.c;h=d4be512a7e1e9584cdace1a12429054fee90e471;hp=ec7bd13fcfa6aff2323d0750c73b39f2949bd5fe;hb=1f37d09e4c7f55cf6f2c3c10ea3ec2424a482671;hpb=7b6175452cb0a9154da31dd571c1425951ec6547 diff --git a/php_http_options.c b/php_http_options.c index ec7bd13..d4be512 100644 --- a/php_http_options.c +++ b/php_http_options.c @@ -16,8 +16,10 @@ static void php_http_options_hash_dtor(zval *pData) { php_http_option_t *opt = Z_PTR_P(pData); + zval_ptr_dtor(&opt->defval); zend_hash_destroy(&opt->suboptions.options); zend_string_release(opt->name); + pefree(opt, opt->persistent); } php_http_options_t *php_http_options_init(php_http_options_t *registry, zend_bool persistent) @@ -82,6 +84,7 @@ php_http_option_t *php_http_option_register(php_http_options_t *registry, const opt.suboptions.getter = registry->getter; opt.suboptions.setter = registry->setter; + opt.persistent = registry->persistent; opt.name = zend_string_init(name_str, name_len, registry->persistent); opt.type = type; opt.option = option; @@ -99,10 +102,6 @@ php_http_option_t *php_http_option_register(php_http_options_t *registry, const ZVAL_LONG(&opt.defval, 0); break; - case IS_STRING: - ZVAL_EMPTY_STRING(&opt.defval); - break; - case IS_DOUBLE: ZVAL_DOUBLE(&opt.defval, 0); break;