cvs: pecl /zip/lib zip_free.c zip_set_archive_comment.c
| From: | Nuno Lopes | Date: | Sun, 12 Nov 2006 00:34:47 +0000 |
| Subject: | cvs: pecl /zip/lib zip_free.c zip_set_archive_comment.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-6622@lists.php.net to get a copy of this message | ||
nlopess Sun Nov 12 00:34:47 2006 UTC
Modified files:
/pecl/zip/lib zip_free.c zip_set_archive_comment.c
Log:
fix leak in setarchivecomment()
http://cvs.php.net/viewvc.cgi/pecl/zip/lib/zip_free.c?r1=1.1&r2=1.2&diff_format=u
Index: pecl/zip/lib/zip_free.c
diff -u pecl/zip/lib/zip_free.c:1.1 pecl/zip/lib/zip_free.c:1.2
--- pecl/zip/lib/zip_free.c:1.1 Sat Jan 14 01:45:34 2006
+++ pecl/zip/lib/zip_free.c Sun Nov 12 00:34:46 2006
@@ -59,6 +59,9 @@
if (za->zp)
fclose(za->zp);
+ if (za->ch_comment)
+ free(za->ch_comment);
+
_zip_cdir_free(za->cdir);
if (za->entry) {
http://cvs.php.net/viewvc.cgi/pecl/zip/lib/zip_set_archive_comment.c?r1=1.1&r2=1.2&diff_format=u
Index: pecl/zip/lib/zip_set_archive_comment.c
diff -u pecl/zip/lib/zip_set_archive_comment.c:1.1 pecl/zip/lib/zip_set_archive_comment.c:1.2
--- pecl/zip/lib/zip_set_archive_comment.c:1.1 Thu May 18 15:12:55 2006
+++ pecl/zip/lib/zip_set_archive_comment.c Sun Nov 12 00:34:46 2006
@@ -60,7 +60,7 @@
else
tmpcom = NULL;
- free(za->ch_comment);
+ if (za->ch_comment) free(za->ch_comment);
za->ch_comment = tmpcom;
za->ch_comment_len = len;