]> granicus.if.org Git - php/commitdiff
Fixed possible memory corruption on request shutdown
authorDmitry Stogov <dmitry@php.net>
Tue, 31 May 2005 17:42:15 +0000 (17:42 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 31 May 2005 17:42:15 +0000 (17:42 +0000)
`valgrind -q --tool=memcheck sapi/cli/php tests/reflection/001.phpt`

main/php_variables.c

index 0283944615d0a90c848f39aefdcec9c4704a934b..d0a6c7d4419c03887be4be641822b170a03c82a8 100644 (file)
@@ -684,6 +684,8 @@ int php_hash_environment(TSRMLS_D)
                                dummy_track_vars_array->refcount++;
                        }
                        PG(http_globals)[i] = dummy_track_vars_array;
+               } else {
+                       PG(http_globals)[i]->refcount++;
                }
 
                zend_hash_update(&EG(symbol_table), auto_global_records[i].name, auto_global_records[i].name_len, &PG(http_globals)[i], sizeof(zval *), NULL);