aboutsummaryrefslogtreecommitdiffstats
path: root/common/list.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-12-15 17:52:53 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-12-15 19:01:41 -0500
commitd75a747a3ddc99f258025a923de1cf4821bf3115 (patch)
tree5fba9582e3d8d71f7d41f420e249d78bc5b4bee8 /common/list.c
parentHandle allocation failure in commands (diff)
downloadsway-d75a747a3ddc99f258025a923de1cf4821bf3115.tar.gz
sway-d75a747a3ddc99f258025a923de1cf4821bf3115.tar.zst
sway-d75a747a3ddc99f258025a923de1cf4821bf3115.zip
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 @@
5 5
6list_t *create_list(void) { 6list_t *create_list(void) {
7 list_t *list = malloc(sizeof(list_t)); 7 list_t *list = malloc(sizeof(list_t));
8 if (!list) {
9 return NULL;
10 }
8 list->capacity = 10; 11 list->capacity = 10;
9 list->length = 0; 12 list->length = 0;
10 list->items = malloc(sizeof(void*) * list->capacity); 13 list->items = malloc(sizeof(void*) * list->capacity);