From a6121b03c81d1d75d5b766526c22e28dda087c69 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 17 Jun 2015 00:25:42 +0000 Subject: [PATCH] iscsi-scstd: Fix a potential file descriptor leak git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6375 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- 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);