From 37e8bf2556ff088ee6886299eac4a6f0883b354a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 19 Sep 2011 17:22:38 +0200 Subject: [PATCH] unix: fix dangling pointer free() bug --- src/unix/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unix/core.c b/src/unix/core.c index 505743b9..61c6f22c 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -634,6 +634,9 @@ int uv_getaddrinfo(uv_loop_t* loop, handle->hints = malloc(sizeof(struct addrinfo)); memcpy(&handle->hints, hints, sizeof(struct addrinfo)); } + else { + handle->hints = NULL; + } /* TODO security! check lengths, check return values. */