From: simon Date: Sat, 26 Aug 2006 08:37:42 +0000 (+0000) Subject: Always initialise the `addresses' field of a SockAddr to NULL, X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/2cd38976187302c0e7a884c507bcd61546bfa4ba 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! git-svn-id: svn://svn.tartarus.org/sgt/putty@6800 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/windows/winnet.c b/windows/winnet.c index 715c492f..47ac8b25 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -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';