tc/em_ipset: Don't leak sockfd on error path
Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
parent
4b45ae221e
commit
3e587d9f43
|
|
@ -84,6 +84,7 @@ static int get_version(unsigned int *version)
|
||||||
res = getsockopt(sockfd, SOL_IP, SO_IP_SET, &req_version, &size);
|
res = getsockopt(sockfd, SOL_IP, SO_IP_SET, &req_version, &size);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
perror("xt_set getsockopt");
|
perror("xt_set getsockopt");
|
||||||
|
close(sockfd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue