diff options
author | Michal Sekletar <msekleta@redhat.com> | 2012-12-13 14:59:39 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2012-12-17 11:41:31 +0100 |
commit | c9c7aef24f9750bbd51d2c13beff66473d96bf3c (patch) | |
tree | 32acb467b38fd1f91b752769800fc1d532988138 | |
parent | d1d7caeeee65c11c54ee1ce0a878024715208a75 (diff) |
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()
-rw-r--r-- | src/shared/path-util.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/path-util.c b/src/shared/path-util.c index 70c8a8af06..dd12d3d634 100644 --- a/src/shared/path-util.c +++ b/src/shared/path-util.c @@ -181,6 +181,7 @@ char **path_strv_canonicalize(char **l) { t = path_make_absolute_cwd(*s); free(*s); + *s = NULL; if (!t) { enomem = true; |