@@ -228,7 +228,7 @@ static zend_string *browscap_intern_str(
228228 } else {
229229 interned = zend_string_copy (str );
230230 if (persistent ) {
231- interned = zend_new_interned_string (str );
231+ interned = zend_new_interned_string (interned );
232232 }
233233 zend_hash_add_new_ptr (& ctx -> str_interned , interned , interned );
234234 }
@@ -397,10 +397,6 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb
397397}
398398/* }}} */
399399
400- static void str_interned_dtor (zval * zv ) {
401- zend_string_release (Z_STR_P (zv ));
402- }
403-
404400static int browscap_read_file (char * filename , browser_data * browdata , int persistent ) /* {{{ */
405401{
406402 zend_file_handle fh ;
@@ -430,7 +426,9 @@ static int browscap_read_file(char *filename, browser_data *browdata, int persis
430426 ctx .bdata = browdata ;
431427 ctx .current_entry = NULL ;
432428 ctx .current_section_name = NULL ;
433- zend_hash_init (& ctx .str_interned , 8 , NULL , str_interned_dtor , persistent );
429+ /* No dtor because we don't inc the refcount for the reference stored within the hash table's entry value
430+ * as the hash table is only temporary anyway. */
431+ zend_hash_init (& ctx .str_interned , 8 , NULL , NULL , persistent );
434432
435433 zend_parse_ini_file (& fh , persistent , ZEND_INI_SCANNER_RAW ,
436434 (zend_ini_parser_cb_t ) php_browscap_parser_cb , & ctx );
0 commit comments