dmitry Tue Apr 18 06:58:10 2006 UTC Modified files: /php-src/sapi/cgi cgi_main.c Log: Fixed memory leaks http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.284&r2=1.285&diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.284 php-src/sapi/cgi/cgi_main.c:1.285 --- php-src/sapi/cgi/cgi_main.c:1.284 Fri Apr 7 13:45:51 2006 +++ php-src/sapi/cgi/cgi_main.c Tue Apr 18 06:58:10 2006 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.284 2006/04/07 13:45:51 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.285 2006/04/18 06:58:10 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -412,12 +412,16 @@ { 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; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php