php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch memleak_fix_for_bug60708 for *General Issues Bug #60708

Patch version 2012-02-02 09:12 UTC

Return to Bug #60708 | Download this patch
Patch Revisions:

Developer: laruence@php.net

Index: trunk/main/php_variables.c
===================================================================
--- trunk/main/php_variables.c	(revision 323011)
+++ trunk/main/php_variables.c	(working copy)
@@ -187,6 +187,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);
 						free_alloca(var_orig, use_heap);
 						return;
 					}
Index: branches/PHP_5_3/main/php_variables.c
===================================================================
--- branches/PHP_5_3/main/php_variables.c	(revision 323011)
+++ branches/PHP_5_3/main/php_variables.c	(working copy)
@@ -199,6 +199,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;
 					}
Index: branches/PHP_5_4/main/php_variables.c
===================================================================
--- branches/PHP_5_4/main/php_variables.c	(revision 323011)
+++ branches/PHP_5_4/main/php_variables.c	(working copy)
@@ -187,6 +187,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);
 						free_alloca(var_orig, use_heap);
 						return;
 					}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 14:01:32 2024 UTC