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:
parent
dd3f04ec40
commit
7a49ff9ac1
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user