Commit f0d45fb270e4306d6933b5c87b858daa87f54786

Thomas de Grivel 2024-12-26T13:12:59

fix alloc_free for NULL arg

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/libkc3/alloc.c b/libkc3/alloc.c
index e35f0b8..179b166 100644
--- a/libkc3/alloc.c
+++ b/libkc3/alloc.c
@@ -88,6 +88,8 @@ void alloc_free (void *allocated)
   s_skiplist_node__alloc *node;
   s_skiplist_node__alloc *pred;
   s_alloc                 pred_alloc = {0};
+  if (! allocated)
+    return;
   pred_alloc.mapped = allocated;
   if (! (pred = skiplist_pred__alloc(g_alloc_skiplist_mapped_size,
                                      &pred_alloc)))