From be7860449c290ec30458a514d36f3bee2a56991b Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 4 Dec 2015 19:09:28 +0100 Subject: [PATCH] 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 --- src/teamspeak2.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.30.2