From d75a747a3ddc99f258025a923de1cf4821bf3115 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 15 Dec 2016 17:52:53 -0500 Subject: Handle config-related allocation failures --- common/list.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common/list.c') diff --git a/common/list.c b/common/list.c index d57234e3..dd864a9b 100644 --- a/common/list.c +++ b/common/list.c @@ -5,6 +5,9 @@ list_t *create_list(void) { list_t *list = malloc(sizeof(list_t)); + if (!list) { + return NULL; + } list->capacity = 10; list->length = 0; list->items = malloc(sizeof(void*) * list->capacity); -- cgit v1.2.3-54-g00ecf