pajoye Fri Aug 8 15:41:25 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/zip php_zip.c
Log:
- MFH: fix leak in zif_zip_entry_read and ::ExtractTo on Error
http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.1.2.38.2.14&r2=1.1.2.38.2.15&diff_format=u
Index: php-src/ext/zip/php_zip.c
diff -u php-src/ext/zip/php_zip.c:1.1.2.38.2.14
php-src/ext/zip/php_zip.c:1.1.2.38.2.15
--- php-src/ext/zip/php_zip.c:1.1.2.38.2.14 Fri Aug 8 15:37:37 2008
+++ php-src/ext/zip/php_zip.c Fri Aug 8 15:41:25 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_zip.c,v 1.1.2.38.2.14 2008/08/08 15:37:37 pajoye Exp $ */
+/* $Id: php_zip.c,v 1.1.2.38.2.15 2008/08/08 15:41:25 pajoye Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1155,7 +1155,7 @@
if (ret != 0) {
efree(zr_rsrc);
- RETURN_LONG((long)ret);
+ RETURN_FALSE;
}
zr_rsrc->zf = zip_fopen_index(rsrc_int->za,
rsrc_int->index_current, 0);
@@ -1163,6 +1163,7 @@
rsrc_int->index_current++;
ZEND_REGISTER_RESOURCE(return_value, zr_rsrc,
le_zip_entry);
} else {
+ efree(zr_rsrc);
RETURN_FALSE;
}
@@ -1244,6 +1245,7 @@
buffer[n] = 0;
RETURN_STRINGL(buffer, n, 0);
} else {
+ efree(buffer);
RETURN_EMPTY_STRING()
}
} else {
@@ -2609,7 +2611,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "Zip", "enabled");
- php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v
1.1.2.38.2.14 2008/08/08 15:37:37 pajoye Exp $");
+ php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v
1.1.2.38.2.15 2008/08/08 15:41:25 pajoye Exp $");
php_info_print_table_row(2, "Zip version", "@PACKAGE_VERSION@");
php_info_print_table_row(2, "Libzip version", "0.7.1");
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php