check the pointer returns from zmalloc
This commit is contained in:
parent
a19d2377cc
commit
188a687150
1 changed files with 2 additions and 0 deletions
|
@ -15,6 +15,8 @@
|
|||
|
||||
str_array * str_array_create(int cap) {
|
||||
str_array * list = (str_array*) zmalloc( sizeof(str_array) );
|
||||
if (!list)
|
||||
return NULL;
|
||||
list->len = 0;
|
||||
list->cap = cap;
|
||||
list->tokens = (char**) zmalloc( sizeof(char*) * cap);
|
||||
|
|
Loading…
Reference in a new issue