johannes                                 Thu, 02 Feb 2012 17:51:44 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=323031

Log:
Merge r323013
Fixed memory leaks (dmitry)

Changed paths:
    _U  php/php-src/branches/PHP_5_3_10/
    _U  php/php-src/branches/PHP_5_3_10/ext/spl/tests/
    _U  php/php-src/branches/PHP_5_3_10/ext/tidy/tests/
    U   php/php-src/branches/PHP_5_3_10/main/php_variables.c
    _U  php/php-src/branches/PHP_5_3_10/sapi/fpm/php-fpm.8.in
    _U  
php/php-src/branches/PHP_5_3_10/tests/security/open_basedir_parse_ini_file.phpt


Property changes on: php/php-src/branches/PHP_5_3_10
___________________________________________________________________
Modified: svn:mergeinfo
   - /php/php-src/branches/PHP_5_3:323007
/php/php-src/trunk:284726,305015,305018-305019
   + /php/php-src/branches/PHP_5_3:323007,323013
/php/php-src/trunk:284726,305015,305018-305019


Property changes on: php/php-src/branches/PHP_5_3_10/ext/spl/tests
___________________________________________________________________
Modified: svn:mergeinfo
   - /php/php-src/branches/PHP_5_3/ext/spl/tests:323007
/php/php-src/trunk:300463
/php/php-src/trunk/ext/spl/tests:284726,300463,300481,305015,305018-305019
   + /php/php-src/branches/PHP_5_3/ext/spl/tests:323007,323013
/php/php-src/trunk:300463
/php/php-src/trunk/ext/spl/tests:284726,300463,300481,305015,305018-305019


Property changes on: php/php-src/branches/PHP_5_3_10/ext/tidy/tests
___________________________________________________________________
Modified: svn:mergeinfo
   - /php/php-src/branches/PHP_5_3/ext/tidy/tests:323007
/php/php-src/trunk/ext/tidy/tests:284726,287798-287941,305015,305018-305019
   + /php/php-src/branches/PHP_5_3/ext/tidy/tests:323007,323013
/php/php-src/trunk/ext/tidy/tests:284726,287798-287941,305015,305018-305019

Modified: php/php-src/branches/PHP_5_3_10/main/php_variables.c
===================================================================
--- php/php-src/branches/PHP_5_3_10/main/php_variables.c        2012-02-02 
17:49:00 UTC (rev 323030)
+++ php/php-src/branches/PHP_5_3_10/main/php_variables.c        2012-02-02 
17:51:44 UTC (rev 323031)
@@ -182,7 +182,12 @@
                        if (!index) {
                                MAKE_STD_ZVAL(gpc_element);
                                array_init(gpc_element);
-                               zend_hash_next_index_insert(symtable1, 
&gpc_element, sizeof(zval *), (void **) &gpc_element_p);
+                               if (zend_hash_next_index_insert(symtable1, 
&gpc_element, sizeof(zval *), (void **) &gpc_element_p) == FAILURE) {
+                                       zval_ptr_dtor(&gpc_element);
+                                       zval_dtor(val);
+                                       efree(var_orig);
+                                       return;
+                               }
                        } else {
                                if (PG(magic_quotes_gpc)) {
                                        escaped_index = php_addslashes(index, 
index_len, &index_len, 0 TSRMLS_CC);
@@ -199,6 +204,10 @@
                                                array_init(gpc_element);
                                                zend_symtable_update(symtable1, 
escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) 
&gpc_element_p);
                                        } else {
+                                               if (index != escaped_index) {
+                                                       efree(escaped_index);
+                                               }
+                                               zval_dtor(val);
                                                efree(var_orig);
                                                return;
                                        }
@@ -226,7 +235,9 @@
                gpc_element->value = val->value;
                Z_TYPE_P(gpc_element) = Z_TYPE_P(val);
                if (!index) {
-                       zend_hash_next_index_insert(symtable1, &gpc_element, 
sizeof(zval *), (void **) &gpc_element_p);
+                       if (zend_hash_next_index_insert(symtable1, 
&gpc_element, sizeof(zval *), (void **) &gpc_element_p) == FAILURE) {
+                               zval_ptr_dtor(&gpc_element);
+                       }
                } else {
                        if (PG(magic_quotes_gpc)) {
                                escaped_index = php_addslashes(index, 
index_len, &index_len, 0 TSRMLS_CC);


Property changes on: php/php-src/branches/PHP_5_3_10/sapi/fpm/php-fpm.8.in
___________________________________________________________________
Modified: svn:mergeinfo
   - /php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.8.in:323007
/php/php-src/trunk/sapi/fpm/php-fpm.1.in:284726
/php/php-src/trunk/sapi/fpm/php-fpm.8.in:305015,305018-305019
   + /php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.8.in:323007,323013
/php/php-src/trunk/sapi/fpm/php-fpm.1.in:284726
/php/php-src/trunk/sapi/fpm/php-fpm.8.in:305015,305018-305019


Property changes on: 
php/php-src/branches/PHP_5_3_10/tests/security/open_basedir_parse_ini_file.phpt
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:323007
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951,305015,305018-305019
   + 
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:323007,323013
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951,305015,305018-305019

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to