aboutsummaryrefslogtreecommitdiffstats
path: root/cpio/cpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpio/cpio.c')
-rw-r--r--cpio/cpio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/cpio/cpio.c b/cpio/cpio.c
index c11ac163122d..373e6da787f5 100644
--- a/cpio/cpio.c
+++ b/cpio/cpio.c
@@ -1324,10 +1324,9 @@ lookup_name(struct cpio *cpio, struct name_cache **name_cache_variable,
if (*name_cache_variable == NULL) {
- *name_cache_variable = malloc(sizeof(struct name_cache));
+ *name_cache_variable = calloc(1, sizeof(struct name_cache));
if (*name_cache_variable == NULL)
lafe_errc(1, ENOMEM, "No more memory");
- memset(*name_cache_variable, 0, sizeof(struct name_cache));
(*name_cache_variable)->size = name_cache_size;
}