From 0e0f1beef7b32f6bb685528fb69f4b27da0b91f5 Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Sat, 23 Mar 2024 12:34:08 -0400 Subject: [PATCH] snapshot v2/p6; fix bug in preserve --- include/sl.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/sl.h b/include/sl.h index 79c41aa..ac0f761 100644 --- a/include/sl.h +++ b/include/sl.h @@ -461,10 +461,16 @@ static int __skip_preserve_##decl(decl##_t *slist, decl##_node_t **path, size_t len) \ { \ int rc = 0, n = 0; \ - size_t i; \ - decl##_node_t *node = path[0]; \ + size_t i = 0; \ + decl##_node_t *node; \ + \ + if (path == NULL) \ + return 0; \ \ for (i = 0; i < len; i++) { \ + node = path[i]; \ + if (node == NULL) \ + continue; \ if (path[i]->field.sle.gen < slist->gen) { \ if (path[i] == slist->slh_head || path[i] == slist->slh_tail) \ continue; \