summaryrefslogtreecommitdiff
path: root/tests/server/resolve.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-11-06 01:32:41 +0100
committerDaniel Stenberg <daniel@haxx.se>2014-11-10 09:06:48 +0100
commita5ad43afe876ab7928c3ace1277860c151aa6fa4 (patch)
treed28963f8a582ddc10dc0f6fbf986285926c1b875 /tests/server/resolve.c
parentfe0f8967bfe911bad290e0438f33e7e03fc444bc (diff)
downloadcurl-a5ad43afe876ab7928c3ace1277860c151aa6fa4.tar.gz
tests: fix memleak in server/resolve.c
This makes LeakSanitizer happy. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'tests/server/resolve.c')
-rw-r--r--tests/server/resolve.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/server/resolve.c b/tests/server/resolve.c
index d0609888a..b84e7fd26 100644
--- a/tests/server/resolve.c
+++ b/tests/server/resolve.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -135,9 +135,11 @@ int main(int argc, char *argv[])
hints.ai_family = PF_INET6;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
- /* Use parenthesis around function to stop it from being replaced by
- the macro in memdebug.h */
+ /* Use parenthesis around functions to stop them from being replaced by
+ the macro in memdebug.h */
rc = (getaddrinfo)(host, "80", &hints, &ai);
+ if (rc == 0)
+ (freeaddrinfo)(ai);
}
#else