[systemd-devel] [PATCH 2/3] [fd leak] Stop leaking an fd in sd_journal_sendv

philippedeswert at gmail.com philippedeswert at gmail.com
Wed Sep 10 12:14:40 PDT 2014


From: Philippe De Swert <philippedeswert at gmail.com>

Found with Coverity. Fixes: CID#996435

Signed-off-by: Philippe De Swert <philippedeswert at gmail.com>
---
 src/journal/journal-send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
index bb1ef66..b7cc4bd 100644
--- a/src/journal/journal-send.c
+++ b/src/journal/journal-send.c
@@ -198,7 +198,7 @@ finish:
 
 _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
         PROTECT_ERRNO;
-        int fd;
+        _cleanup_close_ int fd = -1;
         _cleanup_close_ int buffer_fd = -1;
         struct iovec *w;
         uint64_t *l;
-- 
1.8.3.2



More information about the systemd-devel mailing list