mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
Initialize the allocated 'struct zip'.
This commit is contained in:
parent
68c43d86d1
commit
8b0eda3700
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=202869
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue