]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Clear the allocated 'zip' structure by using calloc() instead of malloc().
authorTim Kientzle <kientzle@gmail.com>
Wed, 6 Jan 2010 06:04:23 +0000 (01:04 -0500)
committerTim Kientzle <kientzle@gmail.com>
Wed, 6 Jan 2010 06:04:23 +0000 (01:04 -0500)
SVN-Revision: 1807

libarchive/archive_write_set_format_zip.c

index f2492805853af9144aed279d7ca9efc703cf1525..14cc6697df03c7d5829da019bbc0b8ef013e3bec 100644 (file)
@@ -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);