From 1a9b1a0ad3e1e98a307c8a99211ebc3a94b4ac3e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 29 Dec 2019 10:12:23 -0800 Subject: fixes #1065 resolver leaks work structures This includes changes to support setting the sanitizer *correctly* (the old code CMake stuff didn't quite get it right), and addresses a number of failures in the test code found by the address sanitizer. --- src/platform/posix/posix_resolv_gai.c | 3 +-- src/platform/windows/win_resolv.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/platform') diff --git a/src/platform/posix/posix_resolv_gai.c b/src/platform/posix/posix_resolv_gai.c index 9e577403..aa70a916 100644 --- a/src/platform/posix/posix_resolv_gai.c +++ b/src/platform/posix/posix_resolv_gai.c @@ -337,9 +337,8 @@ resolv_worker(void *notused) nni_aio_set_sockaddr(aio, &item->sa); nni_aio_finish(aio, rv, 0); - - NNI_FREE_STRUCT(item); } + NNI_FREE_STRUCT(item); } nni_mtx_unlock(&resolv_mtx); } diff --git a/src/platform/windows/win_resolv.c b/src/platform/windows/win_resolv.c index 53a39118..745f03d1 100644 --- a/src/platform/windows/win_resolv.c +++ b/src/platform/windows/win_resolv.c @@ -300,9 +300,8 @@ resolv_worker(void *notused) item->aio = NULL; nni_aio_finish(aio, rv, 0); - - NNI_FREE_STRUCT(item); } + NNI_FREE_STRUCT(item); } nni_mtx_unlock(&resolv_mtx); } -- cgit v1.2.3-70-g09d2