iliaa           Wed Sep 17 23:28:07 2008 UTC

  Modified files:              
    /php-src/ext/xmlwriter      php_xmlwriter.c 
  Log:
  
  MFB: Fixed bug #46110 (XMLWriter - openmemory() and openuri() leak memory on
    multiple calls).
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xmlwriter/php_xmlwriter.c?r1=1.53&r2=1.54&diff_format=u
Index: php-src/ext/xmlwriter/php_xmlwriter.c
diff -u php-src/ext/xmlwriter/php_xmlwriter.c:1.53 
php-src/ext/xmlwriter/php_xmlwriter.c:1.54
--- php-src/ext/xmlwriter/php_xmlwriter.c:1.53  Fri Jun 27 13:17:27 2008
+++ php-src/ext/xmlwriter/php_xmlwriter.c       Wed Sep 17 23:28:07 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_xmlwriter.c,v 1.53 2008/06/27 13:17:27 felipe Exp $ */
+/* $Id: php_xmlwriter.c,v 1.54 2008/09/17 23:28:07 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1886,6 +1886,9 @@
        intern->uri_output = out_buffer;
 #else
        if (this) {
+               if (ze_obj->xmlwriter_ptr) {
+                       xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr 
TSRMLS_CC);
+               }
                ze_obj->xmlwriter_ptr = intern;
                RETURN_TRUE;
        } else
@@ -1936,6 +1939,9 @@
        intern->uri_output = NULL;
 #else
        if (this) {
+               if (ze_obj->xmlwriter_ptr) {
+                       xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr 
TSRMLS_CC);
+               }
                ze_obj->xmlwriter_ptr = intern;
                RETURN_TRUE;
        } else



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

Reply via email to