From 23f3b651818932d5e7fd5d87a3b366b75cf845c2 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 25 May 2018 14:03:13 +0100 Subject: [PATCH] Fix a bad free on portfwd name resolution failure. If name resolution fails, pfd_connect tries to sfree(dummy_realhost) when it's completely uninitialised - the failed resolution didn't write to it, and we also didn't precautionarily initialise it to NULL first. Now we do the latter. --- portfwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portfwd.c b/portfwd.c index b68e4bb8..2512415c 100644 --- a/portfwd.c +++ b/portfwd.c @@ -433,7 +433,7 @@ char *pfd_connect(struct PortForwarding **pf_ret, char *hostname,int port, SockAddr addr; const char *err; - char *dummy_realhost; + char *dummy_realhost = NULL; struct PortForwarding *pf; /*