chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tmpfiles: Fix file descriptor leak on error
[elogind.git]
/
src
/
tmpfiles
/
tmpfiles.c
diff --git
a/src/tmpfiles/tmpfiles.c
b/src/tmpfiles/tmpfiles.c
index c32cbd1aea7d389d85f33dcef531f40c2333fec9..d8fb07e59a1e0008bfc62915be066274da730a14 100644
(file)
--- a/
src/tmpfiles/tmpfiles.c
+++ b/
src/tmpfiles/tmpfiles.c
@@
-409,7
+409,7
@@
static int clean_item(Item *i) {
i->type != IGNORE_PATH)
return 0;
i->type != IGNORE_PATH)
return 0;
- if (!i->age_set
|| i->age <= 0
)
+ if (!i->age_set)
return 0;
n = now(CLOCK_REALTIME);
return 0;
n = now(CLOCK_REALTIME);
@@
-507,8
+507,10
@@
static int write_one_file(Item *i, const char *path) {
_cleanup_free_ char *unescaped;
unescaped = cunescape(i->argument);
_cleanup_free_ char *unescaped;
unescaped = cunescape(i->argument);
- if (unescaped == NULL)
+ if (unescaped == NULL) {
+ close_nointr_nofail(fd);
return log_oom();
return log_oom();
+ }
l = strlen(unescaped);
n = write(fd, unescaped, l);
l = strlen(unescaped);
n = write(fd, unescaped, l);