1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Unix sk_namelookup: fix compile failure at -DNO_IPV6.

The variable 'strbuf *realhost' was only initialised in the branch of
the ifdefs where IPV6 is enabled, so at NO_IPV6, it's used
uninitialised, which in my usual build configuration means a compile
failure.
This commit is contained in:
Simon Tatham 2019-01-29 20:13:12 +00:00
parent ed8a47c1dd
commit af3ccd7946

View File

@ -195,7 +195,7 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname, int address_fami
struct hostent *h = NULL; struct hostent *h = NULL;
int n; int n;
#endif #endif
strbuf *realhost; strbuf *realhost = strbuf_new();
/* Clear the structure and default to IPv4. */ /* Clear the structure and default to IPv4. */
memset(ret, 0, sizeof(SockAddr)); memset(ret, 0, sizeof(SockAddr));
@ -225,7 +225,6 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname, int address_fami
} }
ret->superfamily = IP; ret->superfamily = IP;
realhost = strbuf_new();
if (ret->ais->ai_canonname != NULL) if (ret->ais->ai_canonname != NULL)
strbuf_catf(realhost, "%s", ret->ais->ai_canonname); strbuf_catf(realhost, "%s", ret->ais->ai_canonname);
else else