1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

sk_namelookup: fix memory leak on error exit path.

I remembered to strbuf_free(realhost) on the IPv4-only error exit path
if gethostbyname() returns failure, but not on the _default_ one if
getaddrinfo() does.
This commit is contained in:
Simon Tatham 2019-03-31 11:14:13 +01:00
parent dd3f04ec40
commit 7a49ff9ac1

View File

@ -221,6 +221,7 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname, int address_fami
}
if (err != 0) {
ret->error = gai_strerror(err);
strbuf_free(realhost);
return ret;
}
ret->superfamily = IP;