From: Tim Kientzle Date: Wed, 6 Jan 2010 06:04:23 +0000 (-0500) Subject: Clear the allocated 'zip' structure by using calloc() instead of malloc(). X-Git-Tag: v2.8.0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=641a48703aedff02e9ce10ca5af2964459a92006;p=thirdparty%2Flibarchive.git Clear the allocated 'zip' structure by using calloc() instead of malloc(). SVN-Revision: 1807 --- diff --git a/libarchive/archive_write_set_format_zip.c b/libarchive/archive_write_set_format_zip.c index f24928058..14cc6697d 100644 --- a/libarchive/archive_write_set_format_zip.c +++ b/libarchive/archive_write_set_format_zip.c @@ -231,7 +231,7 @@ archive_write_set_format_zip(struct archive *_a) if (a->format_destroy != NULL) (a->format_destroy)(a); - zip = (struct zip *) malloc(sizeof(*zip)); + zip = (struct zip *) calloc(1, sizeof(*zip)); if (zip == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate zip data"); return (ARCHIVE_FATAL);