[strongSwan-dev] [PATCH 3/3] Fix file descriptor leak

Thomas Jarosch thomas.jarosch at intra2net.com
Fri Aug 26 20:57:10 CEST 2011


Credit goes to "cppcheck".

Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com>
---
 src/libcharon/plugins/ha/ha_kernel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/libcharon/plugins/ha/ha_kernel.c b/src/libcharon/plugins/ha/ha_kernel.c
index 1d619b2..07a2015 100644
--- a/src/libcharon/plugins/ha/ha_kernel.c
+++ b/src/libcharon/plugins/ha/ha_kernel.c
@@ -240,6 +240,7 @@ static segment_mask_t get_active(private_ha_kernel_t *this, char *file)
 		return 0;
 	}
 	len = read(fd, buf, sizeof(buf)-1);
+	close(fd);
 	if (len == -1)
 	{
 		DBG1(DBG_CFG, "reading from CLUSTERIP file '%s' failed: %s",
-- 
1.7.4.4





More information about the Dev mailing list