From: Ruben Kerkhof Date: Fri, 4 Dec 2015 18:09:28 +0000 (+0100) Subject: teamspeak2: fix potential use after close X-Git-Tag: collectd-5.5.1~31^2~8 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=be7860449c290ec30458a514d36f3bee2a56991b;p=collectd.git teamspeak2: fix potential use after close If connecting to the last host fails, we exit the loop with a closed fd, which we try to fdopen() later on. CID #38038 Signed-off-by: Florian Forster --- diff --git a/src/teamspeak2.c b/src/teamspeak2.c index 2552ad30..c8bf4836 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -258,6 +258,7 @@ static int tss2_get_socket (FILE **ret_read_fh, FILE **ret_write_fh) WARNING ("teamspeak2 plugin: connect failed: %s", sstrerror (errno, errbuf, sizeof (errbuf))); close (sd); + sd = -1; continue; }