From: Thomas Jarosch Date: Fri, 26 Aug 2011 18:57:10 +0000 (+0200) Subject: Fix file descriptor leak X-Git-Tag: 4.6.0~533 X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=88d180c7d86fae68d7b37e285398195dd58bcc36 Fix file descriptor leak Credit goes to "cppcheck". Signed-off-by: Thomas Jarosch --- 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",