From 3b85c5fc5a73cfa27f5f3f474f2771130f335aa6 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Tue, 21 Feb 2023 12:39:54 +0100 Subject: [PATCH] added NULL check to all remove_node functions --- src/chat/misc.c | 2 ++ src/core/lib/utils/memory.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/chat/misc.c b/src/chat/misc.c index ec78bc2..0bc7942 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -58,6 +58,8 @@ void push_to_list(int connection) void remove_node(node_t *node) { + if (node == NULL) return; //NULL NODE + node_t *buffer_1 = head; node_t *buffer_2; diff --git a/src/core/lib/utils/memory.c b/src/core/lib/utils/memory.c index ec51324..3ce46bb 100644 --- a/src/core/lib/utils/memory.c +++ b/src/core/lib/utils/memory.c @@ -55,6 +55,8 @@ void push_to_list(void *pointer, enum POINTER_TYPES type) void remove_node(node_t *node) { + if (node == NULL) return; //NULL NODE + node_t *buffer_1 = head; node_t *buffer_2;