Merge branch 'master' into phpng
[m6w6/ext-http] / php_http_options.c
index ec7bd13fcfa6aff2323d0750c73b39f2949bd5fe..d4be512a7e1e9584cdace1a12429054fee90e471 100644 (file)
@@ -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;