cellog          Tue Jun 10 17:58:09 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/phar   util.c 
  Log:
  fix memleak on error
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/util.c?r1=1.55.2.3&r2=1.55.2.4&diff_format=u
Index: php-src/ext/phar/util.c
diff -u php-src/ext/phar/util.c:1.55.2.3 php-src/ext/phar/util.c:1.55.2.4
--- php-src/ext/phar/util.c:1.55.2.3    Thu May 22 06:33:09 2008
+++ php-src/ext/phar/util.c     Tue Jun 10 17:58:09 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: util.c,v 1.55.2.3 2008/05/22 06:33:09 cellog Exp $ */
+/* $Id: util.c,v 1.55.2.4 2008/06/10 17:58:09 cellog Exp $ */
 
 #include "phar_internal.h"
 #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300
@@ -656,6 +656,7 @@
                if (error) {
                        spprintf(error, 0, "phar error: unable to create 
temporary file");
                }
+               efree(ret);
                return NULL;
        }
        etemp.fp_refcount = 1;
@@ -681,6 +682,7 @@
                etemp.tar_type = TAR_FILE;
        }
        if (FAILURE == zend_hash_add(&phar->manifest, etemp.filename, path_len, 
(void*)&etemp, sizeof(phar_entry_info), (void **) &entry)) {
+               efree(ret);
                if (error) {
                        spprintf(error, 0, "phar error: unable to add new entry 
\"%s\" to phar \"%s\"", etemp.filename, phar->fname);
                }
@@ -690,6 +692,7 @@
        if (!entry) {
                php_stream_close(etemp.fp);
                efree(etemp.filename);
+               efree(ret);
                return NULL;
        }
 



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

Reply via email to