From 366454bc69f781fdafc3a30eb6dd77155ee4efb6 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 7 Jan 2002 13:46:50 +0000 Subject: libiptc socket leaking fix --- libiptc/libiptc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libiptc') diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index 73cb217c..3574ac8d 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -1,4 +1,4 @@ -/* Library which manipulates firewall rules. Version $Revision: 1.31 $ */ +/* Library which manipulates firewall rules. Version $Revision: 1.32 $ */ /* Architecture of firewall rules is as follows: * @@ -234,6 +234,9 @@ TC_INIT(const char *tablename) iptc_fn = TC_INIT; + if (sockfd != -1) + close(sockfd); + sockfd = socket(TC_AF, SOCK_RAW, IPPROTO_RAW); if (sockfd < 0) return NULL; -- cgit v1.2.3