From cd4c94024a3bb7df8e0272a39026443801ea6913 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Fri, 3 Feb 2023 16:37:58 +0100 Subject: [PATCH] fixed why2_clean_memory memory leak wow 'garbage collector' that cases memory leaks pls don't laugh at me :( --- src/core/lib/utils/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lib/utils/memory.c b/src/core/lib/utils/memory.c index 5a1c45a..45e09a8 100644 --- a/src/core/lib/utils/memory.c +++ b/src/core/lib/utils/memory.c @@ -147,12 +147,12 @@ void why2_clean_memory(char *identifier) while (buffer -> next != NULL) //GO TROUGH LIST { - if (buffer -> identifier == identifier) remove_node(buffer); + if (buffer -> identifier == identifier) why2_free(buffer -> pointer); buffer = buffer -> next; } - if (buffer -> identifier == identifier) remove_node(buffer); //LAST NODE + if (buffer -> identifier == identifier) why2_free(buffer -> pointer); //LAST NODE why2_reset_memory_identifier(); //THIS WILL CAUSE SEGFAULT IF YOU DIDN'T USE why2_set_memory_identifier } \ No newline at end of file