cellog                                   Fri, 24 Jul 2009 16:21:40 +0000

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

Log:
fix minor memory leak

Changed paths:
    U   pecl/phar/trunk/zip.c
    U   php/php-src/branches/PHP_5_3/ext/phar/zip.c
    U   php/php-src/trunk/ext/phar/zip.c

Modified: pecl/phar/trunk/zip.c
===================================================================
--- pecl/phar/trunk/zip.c       2009-07-24 15:42:17 UTC (rev 284707)
+++ pecl/phar/trunk/zip.c       2009-07-24 16:21:40 UTC (rev 284708)
@@ -2,7 +2,7 @@
   +----------------------------------------------------------------------+
   | ZIP archive support for Phar                                         |
   +----------------------------------------------------------------------+
-  | Copyright (c) 2007-2008 The PHP Group                                |
+  | Copyright (c) 2007-2009 The PHP Group                                |
   +----------------------------------------------------------------------+
   | This source file is subject to version 3.01 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
@@ -310,6 +310,9 @@
                        if (mydata->metadata) { \
                                zval_dtor(mydata->metadata); \
                        } \
+                       if (mydata->signature) { \
+                               efree(mydata->signature); \
+                       } \
                        if (error) { \
                                spprintf(error, 4096, "phar error: %s in 
zip-based phar \"%s\"", errmsg, mydata->fname); \
                        } \
@@ -331,6 +334,9 @@
                        if (mydata->metadata) { \
                                zval_dtor(mydata->metadata); \
                        } \
+                       if (mydata->signature) { \
+                               efree(mydata->signature); \
+                       } \
                        if (error) { \
                                spprintf(error, 4096, "phar error: %s in 
zip-based phar \"%s\"", errmsg, mydata->fname); \
                        } \
@@ -766,7 +772,6 @@
        php_uint32 newcrc32;
        off_t offset;
        int not_really_modified = 0;
-
        entry = (phar_entry_info *)data;
        p = (struct _phar_zip_pass*) arg;


Modified: php/php-src/branches/PHP_5_3/ext/phar/zip.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/phar/zip.c 2009-07-24 15:42:17 UTC (rev 
284707)
+++ php/php-src/branches/PHP_5_3/ext/phar/zip.c 2009-07-24 16:21:40 UTC (rev 
284708)
@@ -310,6 +310,9 @@
                        if (mydata->metadata) { \
                                zval_dtor(mydata->metadata); \
                        } \
+                       if (mydata->signature) { \
+                               efree(mydata->signature); \
+                       } \
                        if (error) { \
                                spprintf(error, 4096, "phar error: %s in 
zip-based phar \"%s\"", errmsg, mydata->fname); \
                        } \
@@ -331,6 +334,9 @@
                        if (mydata->metadata) { \
                                zval_dtor(mydata->metadata); \
                        } \
+                       if (mydata->signature) { \
+                               efree(mydata->signature); \
+                       } \
                        if (error) { \
                                spprintf(error, 4096, "phar error: %s in 
zip-based phar \"%s\"", errmsg, mydata->fname); \
                        } \

Modified: php/php-src/trunk/ext/phar/zip.c
===================================================================
--- php/php-src/trunk/ext/phar/zip.c    2009-07-24 15:42:17 UTC (rev 284707)
+++ php/php-src/trunk/ext/phar/zip.c    2009-07-24 16:21:40 UTC (rev 284708)
@@ -310,6 +310,9 @@
                        if (mydata->metadata) { \
                                zval_dtor(mydata->metadata); \
                        } \
+                       if (mydata->signature) { \
+                               efree(mydata->signature); \
+                       } \
                        if (error) { \
                                spprintf(error, 4096, "phar error: %s in 
zip-based phar \"%s\"", errmsg, mydata->fname); \
                        } \
@@ -331,6 +334,9 @@
                        if (mydata->metadata) { \
                                zval_dtor(mydata->metadata); \
                        } \
+                       if (mydata->signature) { \
+                               efree(mydata->signature); \
+                       } \
                        if (error) { \
                                spprintf(error, 4096, "phar error: %s in 
zip-based phar \"%s\"", errmsg, mydata->fname); \
                        } \
@@ -766,7 +772,6 @@
        php_uint32 newcrc32;
        off_t offset;
        int not_really_modified = 0;
-
        entry = (phar_entry_info *)data;
        p = (struct _phar_zip_pass*) arg;


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

Reply via email to