chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f74e605
)
path-util: fix memory leak
author
Lennart Poettering
<lennart@poettering.net>
Mon, 11 Feb 2013 04:10:23 +0000
(
05:10
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 11 Feb 2013 04:10:23 +0000
(
05:10
+0100)
src/shared/path-util.c
patch
|
blob
|
history
diff --git
a/src/shared/path-util.c
b/src/shared/path-util.c
index ae12c05317f4d34a4f3ae74a52afa46ac3f38e07..52ce65de6d9a8b8e65f6a533ab896c317129c628 100644
(file)
--- a/
src/shared/path-util.c
+++ b/
src/shared/path-util.c
@@
-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;
}