aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_addrinfo.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-03-12 08:37:18 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-03-12 21:45:03 +0100
commit401cb929543e3370726574c01fd90d965c5b3c60 (patch)
tree9a25e32ccdc5b70f4915d1ca4f6e246fb9dc5ef6 /lib/curl_addrinfo.c
parent7e68fed88ba6be7d46df8e45d698b6c2053f8fee (diff)
memdebug: log pointer before freeing its data
Coverity warned for two potentional "Use after free" cases. Both are false positives because the memory wasn't used, it was only the actual pointer value that was logged. The fix still changes the order of execution to avoid the warnings. Coverity CID 1443033 and 1443034 Closes #3671
Diffstat (limited to 'lib/curl_addrinfo.c')
-rw-r--r--lib/curl_addrinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c
index 961311fa3..16c4779c1 100644
--- a/lib/curl_addrinfo.c
+++ b/lib/curl_addrinfo.c
@@ -550,13 +550,13 @@ void
curl_dbg_freeaddrinfo(struct addrinfo *freethis,
int line, const char *source)
{
+ curl_dbg_log("ADDR %s:%d freeaddrinfo(%p)\n",
+ source, line, (void *)freethis);
#ifdef USE_LWIPSOCK
lwip_freeaddrinfo(freethis);
#else
(freeaddrinfo)(freethis);
#endif
- curl_dbg_log("ADDR %s:%d freeaddrinfo(%p)\n",
- source, line, (void *)freethis);
}
#endif /* defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO) */