aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libarchive/libarchive/archive_write_open_memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libarchive/libarchive/archive_write_open_memory.c')
-rw-r--r--contrib/libarchive/libarchive/archive_write_open_memory.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/libarchive/libarchive/archive_write_open_memory.c b/contrib/libarchive/libarchive/archive_write_open_memory.c
index e9e1e29ea73e..8c274f76c619 100644
--- a/contrib/libarchive/libarchive/archive_write_open_memory.c
+++ b/contrib/libarchive/libarchive/archive_write_open_memory.c
@@ -53,12 +53,11 @@ archive_write_open_memory(struct archive *a, void *buff, size_t buffSize, size_t
{
struct write_memory_data *mine;
- mine = (struct write_memory_data *)malloc(sizeof(*mine));
+ mine = (struct write_memory_data *)calloc(1, sizeof(*mine));
if (mine == NULL) {
archive_set_error(a, ENOMEM, "No memory");
return (ARCHIVE_FATAL);
}
- memset(mine, 0, sizeof(*mine));
mine->buff = buff;
mine->size = buffSize;
mine->client_size = used;