1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-26 09:57:26 +03:00

path-util: fix memory leak

This commit is contained in:
Lennart Poettering 2013-02-11 05:10:23 +01:00
parent f74e605fc0
commit 91a6489d99

View File

@ -135,7 +135,8 @@ char *path_make_absolute_cwd(const char *p) {
if (path_is_absolute(p))
return strdup(p);
if (!(cwd = get_current_dir_name()))
cwd = get_current_dir_name();
if (!cwd)
return NULL;
r = path_make_absolute(p, cwd);
@ -190,7 +191,6 @@ char **path_strv_canonicalize(char **l) {
errno = 0;
u = canonicalize_file_name(t);
if (!u) {
if (errno == ENOENT)
u = t;
@ -201,7 +201,8 @@ char **path_strv_canonicalize(char **l) {
continue;
}
}
} else
free(t);
l[k++] = u;
}