pierrick                                 Fri, 20 Jan 2012 13:20:14 +0000

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

Log:
Remove memory leak in substr_replace (to commit in 5.4 after code freeze)

Changed paths:
    U   php/php-src/trunk/ext/standard/string.c

Modified: php/php-src/trunk/ext/standard/string.c
===================================================================
--- php/php-src/trunk/ext/standard/string.c     2012-01-20 12:31:37 UTC (rev 
322496)
+++ php/php-src/trunk/ext/standard/string.c     2012-01-20 13:20:14 UTC (rev 
322497)
@@ -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;
                                        }


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

Reply via email to