aboutsummaryrefslogtreecommitdiff
path: root/libarchive/archive_write_set_format_ar.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_write_set_format_ar.c')
-rw-r--r--libarchive/archive_write_set_format_ar.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libarchive/archive_write_set_format_ar.c b/libarchive/archive_write_set_format_ar.c
index 9f17564c34c3..c9771d81a128 100644
--- a/libarchive/archive_write_set_format_ar.c
+++ b/libarchive/archive_write_set_format_ar.c
@@ -126,12 +126,11 @@ archive_write_set_format_ar(struct archive_write *a)
if (a->format_free != NULL)
(a->format_free)(a);
- ar = (struct ar_w *)malloc(sizeof(*ar));
+ ar = (struct ar_w *)calloc(1, sizeof(*ar));
if (ar == NULL) {
archive_set_error(&a->archive, ENOMEM, "Can't allocate ar data");
return (ARCHIVE_FATAL);
}
- memset(ar, 0, sizeof(*ar));
a->format_data = ar;
a->format_name = "ar";