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:
parent
f74e605fc0
commit
91a6489d99
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user