From 9fe37ecb8d9c86c7d05a3449aa2d82b7c50c7be8 Mon Sep 17 00:00:00 2001 From: laforge 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(-) diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index 73cb217..3574ac8 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