From 951d112a4f3b8b035713c3c97741fb392f399f78 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sat, 4 Feb 2023 17:27:09 +0100 Subject: [PATCH] added empty list check to remove_node_from_end --- src/core/lib/flags.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/lib/flags.c b/src/core/lib/flags.c index 15e3a90..366ae9a 100644 --- a/src/core/lib/flags.c +++ b/src/core/lib/flags.c @@ -66,6 +66,8 @@ void push_to_list_end(char *identifier) void remove_node_from_end(void) { + if (list_head == NULL) return; //EMPTY LIST + node_t *buffer = list_head; if (buffer -> next == NULL) //ONLY ONE NODE