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:
Michal Sekletar 2012-12-13 14:59:39 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent d1d7caeeee
commit c9c7aef24f

View file

@ -181,6 +181,7 @@ char **path_strv_canonicalize(char **l) {
t = path_make_absolute_cwd(*s);
free(*s);
*s = NULL;
if (!t) {
enomem = true;