From 9bfa7453ec628fa13d1d40ce7130f7aa6af95c1e Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Thu, 2 Feb 2023 15:50:43 +0100 Subject: [PATCH] fixed why2_realloc memory leak so basically - this function was running realloc SO free() was used... I need why2_free() :D fixed that fucking leak yay --- src/core/lib/utils/memory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/lib/utils/memory.c b/src/core/lib/utils/memory.c index a2d0114..e4d0d68 100644 --- a/src/core/lib/utils/memory.c +++ b/src/core/lib/utils/memory.c @@ -109,7 +109,9 @@ void *why2_calloc(unsigned long element, unsigned long size) void *why2_realloc(void *pointer, unsigned long size) { - void *allocated = realloc(pointer, size); + if (pointer != NULL) why2_free(pointer); + + void *allocated = malloc(size); push_to_list(allocated);