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

Always initialise the `addresses' field of a SockAddr to NULL,

because it gets unconditionally sfree()d in sk_addr_free(). This
just bit me when running under the MSVC debugger; not sure how it
hasn't bitten anyone until now!

[originally from svn r6800]
This commit is contained in:
Simon Tatham 2006-08-26 08:37:42 +00:00
parent 911f43b872
commit 44a246aaa7

View File

@ -356,6 +356,7 @@ SockAddr sk_namelookup(const char *host, char **canonicalname,
#ifndef NO_IPV6
ret->ai = ret->ais = NULL;
#endif
ret->addresses = NULL;
ret_family = AF_UNSPEC;
*realhost = '\0';
@ -456,6 +457,7 @@ SockAddr sk_nonamelookup(const char *host)
#ifndef NO_IPV6
ret->ai = ret->ais = NULL;
#endif
ret->addresses = NULL;
ret->naddresses = 0;
strncpy(ret->hostname, host, lenof(ret->hostname));
ret->hostname[lenof(ret->hostname)-1] = '\0';