[PATCH 2/5] Close fd before return to avoid resource leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Honggang Li <honli@xxxxxxxxxx>

Issue was found by Coverity.

Signed-off-by: Honggang Li <honli@xxxxxxxxxx>
---
 opensm/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/opensm/main.c b/opensm/main.c
index ba20d985..2d23fe2b 100644
--- a/opensm/main.c
+++ b/opensm/main.c
@@ -565,6 +565,8 @@ static int daemonize(osm_opensm_t * osm)
 	dup2(fd, 1);
 	dup2(fd, 2);
 
+	close(fd);
+
 	return 0;
 }
 
-- 
2.14.4




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux