projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c981ff
)
tmpfiles: Fix file descriptor leak on error
author
Thomas Jarosch
<thomas.jarosch@intra2net.com>
Tue, 25 Dec 2012 12:46:46 +0000
(13:46 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 3 Jan 2013 21:42:55 +0000
(22:42 +0100)
Detected by cppcheck
src/tmpfiles/tmpfiles.c
patch
|
blob
|
history
diff --git
a/src/tmpfiles/tmpfiles.c
b/src/tmpfiles/tmpfiles.c
index
c27d011
..
d8fb07e
100644
(file)
--- a/
src/tmpfiles/tmpfiles.c
+++ b/
src/tmpfiles/tmpfiles.c
@@
-507,8
+507,10
@@
static int write_one_file(Item *i, const char *path) {
_cleanup_free_ char *unescaped;
unescaped = cunescape(i->argument);
- if (unescaped == NULL)
+ if (unescaped == NULL) {
+ close_nointr_nofail(fd);
return log_oom();
+ }
l = strlen(unescaped);
n = write(fd, unescaped, l);