projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f863b1c
)
nspawn: make sure we don't leak the fd in chase_symlinks_and_update
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Thu, 15 Feb 2018 09:18:25 +0000
(10:18 +0100)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Thu, 15 Feb 2018 09:18:25 +0000
(10:18 +0100)
No callers use CHASE_OPEN right now, but let's be defensive.
src/nspawn/nspawn.c
patch
|
blob
|
history
diff --git
a/src/nspawn/nspawn.c
b/src/nspawn/nspawn.c
index 0f05ecff03266d94c41490f8b1fc9ca5d0c88124..7405359cc746b7fd28ef5ba2588a6419bf11f0c1 100644
(file)
--- a/
src/nspawn/nspawn.c
+++ b/
src/nspawn/nspawn.c
@@
-2233,10
+2233,8
@@
static int chase_symlinks_and_update(char **p, unsigned flags) {
if (r < 0)
return log_error_errno(r, "Failed to resolve path %s: %m", *p);
- free(*p);
- *p = chased;
-
- return 0;
+ free_and_replace(*p, chased);
+ return r; /* r might be an fd here in case we ever use CHASE_OPEN in flags */
}
static int determine_uid_shift(const char *directory) {