wmem: allow wmem_destroy_list to ignore a NULL list.
authorStefan Metzmacher <metze@samba.org>
Tue, 21 Jun 2016 06:55:35 +0000 (08:55 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 20 Jan 2019 22:14:58 +0000 (23:14 +0100)
I think this should not lead to a crash.

Change-Id: Ic9d903d355f925b2cd5239d51b42f441679ed771
Signed-off-by: Stefan Metzmacher <metze@samba.org>
epan/wmem/wmem_list.c

index b6d4ecbb37d430950b1d2e854626cb26410a5c90..16b085e507559caaba27fc827143288de3e0cb13 100644 (file)
@@ -236,6 +236,10 @@ wmem_destroy_list(wmem_list_t *list)
 {
     wmem_list_frame_t *cur, *next;
 
+    if (list == NULL) {
+        return;
+    }
+
     cur = list->head;
 
     while (cur) {