]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc/em_ipset: Don't leak sockfd on error path
authorPhil Sutter <phil@nwl.cc>
Thu, 17 Aug 2017 17:09:31 +0000 (19:09 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 18 Aug 2017 16:16:59 +0000 (09:16 -0700)
Signed-off-by: Phil Sutter <phil@nwl.cc>
tc/em_ipset.c

index fab975f5ea563814be827d84ecb80faa28d35135..b59756515d2394d178ccead5d0dd6d4d70d58332 100644 (file)
@@ -84,6 +84,7 @@ static int get_version(unsigned int *version)
        res = getsockopt(sockfd, SOL_IP, SO_IP_SET, &req_version, &size);
        if (res != 0) {
                perror("xt_set getsockopt");
+               close(sockfd);
                return -1;
        }