Remove memory leak in PHP5.4 for bug 55971

From: Date: Fri, 20 Jan 2012 03:35:53 +0000
Subject: Remove memory leak in PHP5.4 for bug 55971
Groups: php.internals 
Request: Send a blank email to internals+get-57448@lists.php.net to get a copy of this message
Hi Stas, I did run the test of bug #55871 and got memory leaks. This patch remove them. Could you please review the patch and if it is Ok i'll commit it to 5.4 Thanks Pierrick

Index: NEWS =================================================================== --- NEWS (revision 322482) +++ NEWS (working copy) @@ -2,6 +2,9 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Jan 2012, PHP 5.4.0 +- Standard: + . Fixed memory leak in substr_replace. (Pierrick) + 19 Jan 2012, PHP 5.4.0 RC6 - Core: Index: ext/standard/string.c =================================================================== --- ext/standard/string.c (revision 322482) +++ ext/standard/string.c (working copy) @@ -2518,6 +2518,9 @@ if(Z_REFCOUNT_P(orig_str) != refcount) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument was modified while replacing"); + if(Z_TYPE_PP(tmp_repl) != IS_STRING) { + zval_dtor(repl_str); + } break; }
« previous php.internals (#57448) next »