From a0aabc547a314b1fbd836e258e28281a593410d2 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sun, 27 Aug 2023 12:18:51 +0200 Subject: [PATCH] updated performance in why2_deallocate now if you attempt to deallocate NULL, get_node doesn't go trough the whole list --- src/core/lib/utils/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/lib/utils/memory.c b/src/core/lib/utils/memory.c index 3ce46bb..3c8ff3e 100644 --- a/src/core/lib/utils/memory.c +++ b/src/core/lib/utils/memory.c @@ -90,7 +90,7 @@ void remove_node(node_t *node) node_t *get_node(void *pointer) { - if (head == NULL) return NULL; //EMPTY LIST + if (head == NULL || pointer == NULL) return NULL; //EMPTY LIST node_t *buffer = head; while (buffer -> next != NULL)