path-util: set pointer to null after calling free()
In cases where path_strv_canonicalize() returns NULL, strv_free() is called afterwards and it will call free() on pointers which were freed already in path_strv_canonicalize()
This commit is contained in:
parent
d1d7caeeee
commit
c9c7aef24f
|
@ -181,6 +181,7 @@ char **path_strv_canonicalize(char **l) {
|
|||
|
||||
t = path_make_absolute_cwd(*s);
|
||||
free(*s);
|
||||
*s = NULL;
|
||||
|
||||
if (!t) {
|
||||
enomem = true;
|
||||
|
|
Loading…
Reference in a new issue