From 94af8a10821b23e20d89aea71d6be5a96e7514f6 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 5 May 2015 14:59:01 +0200 Subject: [PATCH] iscsi-scstd: Fix a file descriptor leak Detected by Coverity. Signed-off-by: Bart Van Assche --- iscsi-scst/usr/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscsi-scst/usr/message.c b/iscsi-scst/usr/message.c index acd257153..a0f34f0f3 100644 --- a/iscsi-scst/usr/message.c +++ b/iscsi-scst/usr/message.c @@ -194,7 +194,7 @@ send: err = writev(fd, iov, 2 + !!iov[2].iov_len); out: - if (fd > 0) + if (fd >= 0) close(fd); if (rsp_data) free(rsp_data);