Fix unchecked calloc result in tree_push
If calloc fails, te would be NULL and immediately dereferenced. Return early on allocation failure.
This commit is contained in:
1 parent
589004793a
commit
f5bb79a62e
1 file changed
+2
@@ -1634,6 +1634,8 @@ tree_push(struct tree *t, const wchar_t *path, const wchar_t *full_path,
|
||||
struct tree_entry *te;
|
||||
|
||||
te = calloc(1, sizeof(*te));
|
||||
if (te == NULL)
|
||||
return;
|
||||
te->next = t->stack;
|
||||
te->parent = t->current;
|
||||
if (te->parent)
|
||||
|
||||
Reference in new issue
Block a user