diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2016-12-06 15:58:03 +0100 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2016-12-06 15:58:03 +0100 |
commit | 72abdbb8ba51e926432de242f4df5cf632546dc9 (patch) | |
tree | 95764c8621b49dcf02215011b69d28f301478cdd /libarchive/archive_read_support_format_mtree.c | |
parent | d4d4f91251a084d036518afb8423350c48914bf1 (diff) | |
download | libarchive-72abdbb8ba51e926432de242f4df5cf632546dc9.tar.gz |
Replace malloc + memset with calloc.
Diffstat (limited to 'libarchive/archive_read_support_format_mtree.c')
-rw-r--r-- | libarchive/archive_read_support_format_mtree.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c index 85c655fb..d0aa84cc 100644 --- a/libarchive/archive_read_support_format_mtree.c +++ b/libarchive/archive_read_support_format_mtree.c @@ -229,13 +229,12 @@ archive_read_support_format_mtree(struct archive *_a) archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_support_format_mtree"); - mtree = (struct mtree *)malloc(sizeof(*mtree)); + mtree = (struct mtree *)calloc(1, sizeof(*mtree)); if (mtree == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate mtree data"); return (ARCHIVE_FATAL); } - memset(mtree, 0, sizeof(*mtree)); mtree->fd = -1; r = __archive_read_register_format(a, mtree, "mtree", |