From: Harald Welte Date: Mon, 7 Jan 2002 13:46:50 +0000 (+0000) Subject: libiptc socket leaking fix X-Git-Tag: v1.2.5~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=366454bc69f781fdafc3a30eb6dd77155ee4efb6;p=thirdparty%2Fiptables.git libiptc socket leaking fix --- 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;