From: Nuno Lopes Date: Sat, 11 Nov 2006 23:36:52 +0000 (+0000) Subject: MFB :fix leak in oo_setArchiveComment.phpt X-Git-Tag: RELEASE_1_0_0RC1~1053 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d34fc386bafc29058cc82fe902b4b6f55abd1a57;p=php MFB :fix leak in oo_setArchiveComment.phpt --- diff --git a/ext/zip/lib/zip_free.c b/ext/zip/lib/zip_free.c index cbead2a6b7..c78697d254 100644 --- a/ext/zip/lib/zip_free.c +++ b/ext/zip/lib/zip_free.c @@ -59,6 +59,9 @@ _zip_free(struct zip *za) if (za->zp) fclose(za->zp); + if (za->ch_comment) + free(za->ch_comment); + _zip_cdir_free(za->cdir); if (za->entry) { diff --git a/ext/zip/lib/zip_set_archive_comment.c b/ext/zip/lib/zip_set_archive_comment.c index 51a8416da4..b0929e56b6 100644 --- a/ext/zip/lib/zip_set_archive_comment.c +++ b/ext/zip/lib/zip_set_archive_comment.c @@ -60,7 +60,7 @@ zip_set_archive_comment(struct zip *za, const char *comment, int len) else tmpcom = NULL; - free(za->ch_comment); + if (za->ch_comment) free(za->ch_comment); za->ch_comment = tmpcom; za->ch_comment_len = len;