diff options
author | Dmitry Stogov <dmitry@php.net> | 2006-04-18 06:58:54 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2006-04-18 06:58:54 +0000 |
commit | 83657db8ff07a9162ab025754d23fa46723de21f (patch) | |
tree | f1b0f0528c27f8f19ef85b509a238f7f888f6338 /sapi/cgi/cgi_main.c | |
parent | d2de055ef1371ae963581fddf5b365596609308d (diff) | |
download | php-git-83657db8ff07a9162ab025754d23fa46723de21f.tar.gz |
Fixed memory leaks
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r-- | sapi/cgi/cgi_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 61983df755..b01902f39a 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -412,12 +412,16 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) { if (PG(http_globals)[TRACK_VARS_ENV] && array_ptr != PG(http_globals)[TRACK_VARS_ENV]) { + zval_dtor(array_ptr); *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; + INIT_PZVAL(array_ptr); zval_copy_ctor(array_ptr); return; } else if (PG(http_globals)[TRACK_VARS_SERVER] && array_ptr != PG(http_globals)[TRACK_VARS_SERVER]) { + zval_dtor(array_ptr); *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; + INIT_PZVAL(array_ptr); zval_copy_ctor(array_ptr); return; } |