summaryrefslogtreecommitdiff
path: root/lib/typesafe.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-07-06 10:35:24 +0200
committerGitHub <noreply@github.com>2022-07-06 10:35:24 +0200
commit5adddad38f7716d7d118204b3ac39f5b18040305 (patch)
tree15b39280513962abf0e5776edbe34a3adb20a14b /lib/typesafe.h
parente894ef7e77157f0a5d7a2be7b572a949c645dbe3 (diff)
parentf580074e61d487fd83d0160629b1de3486df98b2 (diff)
Merge pull request #11534 from mjstapp/fix_typesafe_sa
lib: fix SA warning in typesafe code
Diffstat (limited to 'lib/typesafe.h')
-rw-r--r--lib/typesafe.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/typesafe.h b/lib/typesafe.h
index 06fdc52e78..df963f530d 100644
--- a/lib/typesafe.h
+++ b/lib/typesafe.h
@@ -309,7 +309,8 @@ static inline void typesafe_dlist_add(struct dlist_head *head,
struct dlist_item *prev, struct dlist_item *item)
{
item->next = prev->next;
- item->next->prev = item;
+ if (item->next)
+ item->next->prev = item;
item->prev = prev;
prev->next = item;
head->count++;