diff mbox

[conntrack-tools] Fix file descriptor leak in channel_open() on error

Message ID 5488C193.2030707@intra2net.com
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Thomas Jarosch Dec. 10, 2014, 9:56 p.m. UTC
Detected by cppcheck

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
 src/channel.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Pablo Neira Ayuso Dec. 10, 2014, 11:36 p.m. UTC | #1
On Wed, Dec 10, 2014 at 10:56:35PM +0100, Thomas Jarosch wrote:
> Detected by cppcheck

Applied, thanks Thomas.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/channel.c b/src/channel.c
index 8b7c319..acbfa7d 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -109,6 +109,7 @@  channel_open(struct channel_conf *cfg)
 
 	if (ioctl(fd, SIOCGIFMTU, &ifr) == -1) {
 		free(c);
+		close(fd);
 		return NULL;
 	}
 	close(fd);