aboutsummaryrefslogtreecommitdiff
path: root/src/helper/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper/list.h')
-rw-r--r--src/helper/list.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/helper/list.h b/src/helper/list.h
index ba07f15..89b8468 100644
--- a/src/helper/list.h
+++ b/src/helper/list.h
@@ -35,6 +35,7 @@
/* begin OpenOCD changes */
+#include <assert.h>
#include <stddef.h>
struct list_head {
@@ -109,6 +110,9 @@ static inline void
linux_list_add(struct list_head *new, struct list_head *prev,
struct list_head *next)
{
+ assert(next);
+ assert(prev);
+
next->prev = new;
new->next = next;
new->prev = prev;