X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-raphf;a=blobdiff_plain;f=php_raphf.c;h=4ce908ec0a3c92d921e600c9e84be52996e6d46d;hp=1e4276bd6f78483565c3464e8f4db0c34a442f5f;hb=420e806326b7c9be3130e5d97055b6215d6c7b8d;hpb=502a992120e983e28b1adad77c7bc5096fdc3df2 diff --git a/php_raphf.c b/php_raphf.c index 1e4276b..4ce908e 100644 --- a/php_raphf.c +++ b/php_raphf.c @@ -243,10 +243,21 @@ static inline php_persistent_handle_list_t *php_persistent_handle_list_find( } if ((list = php_persistent_handle_list_init(NULL))) { - zval p; + zval p, *rv; + zend_string *id; ZVAL_PTR(&p, list); - if (zend_symtable_update(&provider->list.free, ident, &p)) { + if ((GC_FLAGS(ident) & IS_STR_PERSISTENT)) { + id = ident; + } else { + id = zend_string_dup(ident, 1); + } + rv = zend_symtable_update(&provider->list.free, id, &p); + if (id != ident) { + zend_string_release(id); + } + + if (rv) { #if PHP_RAPHF_DEBUG_PHANDLES fprintf(stderr, "LSTFIND: %p (new)\n", list); #endif