]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Issue 191: Clear struct stat so that fields not explicitly
authorTim Kientzle <kientzle@gmail.com>
Wed, 9 Nov 2011 04:15:36 +0000 (23:15 -0500)
committerTim Kientzle <kientzle@gmail.com>
Wed, 9 Nov 2011 04:15:36 +0000 (23:15 -0500)
set by libarchive won't have garbage values.

SVN-Revision: 3760

libarchive/archive_entry_stat.c

index ad772c9564b645211a768265d88d08c0912ee6e5..d5ed1cb131f4239ea38707b7f7b4cf344e8bdb1a 100644 (file)
@@ -41,7 +41,7 @@ archive_entry_stat(struct archive_entry *entry)
 {
        struct stat *st;
        if (entry->stat == NULL) {
-               entry->stat = malloc(sizeof(*st));
+               entry->stat = calloc(1, sizeof(*st));
                if (entry->stat == NULL)
                        return (NULL);
                entry->stat_valid = 0;