From e622923e19e664e3f397db7be76252e157abb582 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 23 Jun 2024 21:56:25 +0100 Subject: [PATCH] Zero memory when allocating list --- src/list/typed_list.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/list/typed_list.c b/src/list/typed_list.c index 3386f02..2063e7f 100644 --- a/src/list/typed_list.c +++ b/src/list/typed_list.c @@ -1,5 +1,7 @@ #include "list/typed_list.h" +#include #include +#include #include list_void_t *_create_list(u64 size, u64 count) { @@ -13,6 +15,7 @@ list_void_t *_create_list(u64 size, u64 count) { munmap(list, sizeof(list_void_t)); return NULL; } + memset(list->items, 0, sizeof(size * count)); list->capacity = count; list->count = 0;