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:
Tim Kientzle committed 2026-05-16 10:02:57 -07:00
1 parent 589004793a
commit f5bb79a62e
1 file changed
+2
+2
View File
@@ -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)