diff options
Diffstat (limited to 'Src/linklist.c')
-rw-r--r-- | Src/linklist.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/linklist.c b/Src/linklist.c index 1e364fb4e..3aa8125d9 100644 --- a/Src/linklist.c +++ b/Src/linklist.c @@ -118,6 +118,8 @@ znewlinklist(void) LinkList list; list = (LinkList) zalloc(sizeof *list); + if (!list) + return NULL; list->list.first = NULL; list->list.last = &list->node; list->list.flags = 0; @@ -152,6 +154,8 @@ zinsertlinknode(LinkList list, LinkNode node, void *dat) tmp = node->next; node->next = new = (LinkNode) zalloc(sizeof *tmp); + if (!new) + return NULL; new->prev = node; new->dat = dat; new->next = tmp; |