Making check in examples
Making check in CFHost
make CFHostExample
CCLD CFHostExample
/bin/bash ../../libtool --mode execute ./CFHostExample
Asynchronous lookups...
By name 'localhost' (Forward DNS)...
Resolved names:
0: localhost
Resolved addresses:
0: ::1
1: 127.0.0.1
=================================================================
==1551143==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 10 byte(s) in 1 object(s) allocated from:
#0 0x7fac81a14bc8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
#1 0x7fac81325487 in ares_strdup (/usr/local/lib/libcares.so.2+0x10487)
When invoking
ares_gethostbynamefor a forward DNS name-to-address lookup, there seems to be a leak fromares_strdup, as reported by the clang/LLVM address sanitizer:This was/is demonstrated against c-ares-1.18.1 using https://github.com/gerickson/opencfnetwork/blob/user/gerickson/github-issue-8-forward-dns-deadlock/third_party/CFNetwork/repo/Host/CFHost.c#L2770 along with the example application https://github.com/gerickson/opencfnetwork/blob/user/gerickson/github-issue-8-forward-dns-deadlock/examples/CFHost/CFHostExample.c.