aboutsummaryrefslogtreecommitdiff
path: root/common/list.c
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2016-12-15 17:52:53 -0500
committerFurkan Sahin <furkan-dev@proton.me>2016-12-15 17:52:53 -0500
commit6ae0bec625f1aceb3b26caf38fef96f3a36c94b0 (patch)
tree5fba9582e3d8d71f7d41f420e249d78bc5b4bee8 /common/list.c
parenta4c3893e6439809347e89b81c619d7bb688f594c (diff)
Handle config-related allocation failures
Diffstat (limited to 'common/list.c')
-rw-r--r--common/list.c3
1 files changed, 3 insertions, 0 deletions
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);