]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libiptc socket leaking fix
authorHarald Welte <laforge@gnumonks.org>
Mon, 7 Jan 2002 13:46:50 +0000 (13:46 +0000)
committerHarald Welte <laforge@gnumonks.org>
Mon, 7 Jan 2002 13:46:50 +0000 (13:46 +0000)
libiptc/libiptc.c

index 73cb217c216760eedd209fee54ec09db6e5a0d29..3574ac8d0cce184bb81855f86a1b5aa487a4b77b 100644 (file)
@@ -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;