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);
}
lst_addback(root, current);
content = malloc(sizeof(cmd));
content = calloc(sizeof(cmd), 1);
if (content == NULL)
{
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;
i++;
}
tab[i] = NULL;
return tab;
}