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:
committed by
Zbigniew Jędrzejewski-Szmek
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;
|
||||
|
||||
Reference in New Issue
Block a user