fix: invalid read

This commit is contained in:
starnakin 2023-07-01 11:45:16 +02:00
parent 645c4c98ea
commit e946b215cf
2 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,7 @@ lst** cmds_init(size_t len)
return (NULL); return (NULL);
} }
lst_addback(root, current); lst_addback(root, current);
content = malloc(sizeof(cmd)); content = calloc(sizeof(cmd), 1);
if (content == NULL) if (content == NULL)
{ {
lst_clear(root, &free); lst_clear(root, &free);

1
src/env/env.c vendored
View File

@ -171,5 +171,6 @@ char **get_env_str(lst** root)
current = current->next; current = current->next;
i++; i++;
} }
tab[i] = NULL;
return tab; return tab;
} }