From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org
Subject: [iproute PATCH v2 2/2] tc/em_ipset: Don't leak sockfd on error path
Date: Thu, 17 Aug 2017 19:09:31 +0200 [thread overview]
Message-ID: <20170817170931.24224-3-phil@nwl.cc> (raw)
In-Reply-To: <20170817170931.24224-1-phil@nwl.cc>
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
tc/em_ipset.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tc/em_ipset.c b/tc/em_ipset.c
index fab975f5ea563..b59756515d239 100644
--- a/tc/em_ipset.c
+++ b/tc/em_ipset.c
@@ -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;
}
--
2.13.1
next prev parent reply other threads:[~2017-08-17 17:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 17:09 [iproute PATCH v2 0/2] Covscan: Fix potential file descriptor leaks Phil Sutter
2017-08-17 17:09 ` [iproute PATCH v2 1/2] ss: Don't leak fd in tcp_show_netlink_file() Phil Sutter
2017-08-17 17:09 ` Phil Sutter [this message]
2017-08-18 16:18 ` [iproute PATCH v2 0/2] Covscan: Fix potential file descriptor leaks Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170817170931.24224-3-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox