DynamoRIO / DynamoRIO/drmemory
Possible memory leaks when using getaddrinfo
- Dominant language
- C
- Stars
- 2.7k
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
_From [timurrrr@google.com](https://code.google.com/u/timurrrr@google.com/) on June 03, 2011 10:48:18_
Repros are given as examples here: http://msdn.microsoft.com/en-us/library/ms738519(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/ms738520(v=vs.85).aspx run like this:
$ test.exe www.google.com 80
-> (besides known uninit reports)
Error `#1`: POSSIBLE LEAK 20 direct bytes 0x00c29ec0-0x00c29ed4 + 0 indirect bytes
0x76d64e1d iphlpapi.dll!IcmpCreateFile
0x76d64e95 iphlpapi.dll!IcmpCreateFile
0x76d6546b iphlpapi.dll!GetNumberOfInterfaces
0x76d65351 iphlpapi.dll!GetNumberOfInterfaces
0x7c90118a ntdll.dll!LdrInitializeThunk
0x7c91b5d2 ntdll.dll!LdrFindResourceDirectory_U
0x7c9162db ntdll.dll!RtlValidateUnicodeString
0x7c91643d ntdll.dll!LdrLoadDll
0x7c801bbd KERNEL32.dll!LoadLibraryExW
0x7c801d72 KERNEL32.dll!LoadLibraryExA
0x7c801da8 KERNEL32.dll!LoadLibraryA
0x76f2ab0a DNSAPI.dll!DnsGetLocalAddrArrayDirect
0x76f2ab98 DNSAPI.dll!DnsGetLocalAddrArrayDirect
0x76f28312 DNSAPI.dll!NetInfo_Build
0x76f27d0b DNSAPI.dll!DnsQueryConfig
0x76f27c15 DNSAPI.dll!DnsQueryConfig
0x76f22e4b DNSAPI.dll!DnsQuery_W
0x71a5a129 MSWSOCK.dll!SvchostPushServiceGlobals
0x71a5c7ce MSWSOCK.dll!WSPStartup
0x71a5c90c MSWSOCK.dll!WSPStartup
0x71ab4ece WS2_32.dll!WSARecv
0x71ab4df6 WS2_32.dll!WSARecv
0x71ab4d91 WS2_32.dll!WSARecv
0x71ab2e96 WS2_32.dll!htons
0x71ab373e WS2_32.dll!WSALookupServiceBeginW
0x71ab3673 WS2_32.dll!WSALookupServiceBeginW
0x71ab6104 WS2_32.dll!WSALookupServiceNextA
0x71ab9c2f WS2_32.dll!WSAStringToAddressA
0x71ab5e58 WS2_32.dll!WSALookupServiceNextA
0x71ab5ddc WS2_32.dll!WSALookupServiceNextA
0x00401175 test.exe!wmain
test.cpp:75
and
Error `#2`: POSSIBLE LEAK 64 direct bytes 0x00c38068-0x00c380a8 + 0 indirect bytes
0x76d65cde iphlpapi.dll!AllocateAndGetArpEntTableFromStack
0x76d65e49 iphlpapi.dll!AllocateAndGetArpEntTableFromStack
0x76d65478 iphlpapi.dll!GetNumberOfInterfaces
0x76d65351 iphlpapi.dll!GetNumberOfInterfaces
0x7c90118a ntdll.dll!LdrInitializeThunk
0x7c91b5d2 ntdll.dll!LdrFindResourceDirectory_U
0x7c9162db ntdll.dll!RtlValidateUnicodeString
0x7c91643d ntdll.dll!LdrLoadDll
0x7c801bbd KERNEL32.dll!LoadLibraryExW
0x7c801d72 KERNEL32.dll!LoadLibraryExA
0x7c801da8 KERNEL32.dll!LoadLibraryA
0x76f2ab0a DNSAPI.dll!DnsGetLocalAddrArrayDirect
0x76f2ab98 DNSAPI.dll!DnsGetLocalAddrArrayDirect
0x76f28312 DNSAPI.dll!NetInfo_Build
0x76f27d0b DNSAPI.dll!DnsQueryConfig
0x76f27c15 DNSAPI.dll!DnsQueryConfig
0x76f22e4b DNSAPI.dll!DnsQuery_W
0x71a5a129 MSWSOCK.dll!SvchostPushServiceGlobals
0x71a5c7ce MSWSOCK.dll!WSPStartup
0x71a5c90c MSWSOCK.dll!WSPStartup
0x71ab4ece WS2_32.dll!WSARecv
0x71ab4df6 WS2_32.dll!WSARecv
0x71ab4d91 WS2_32.dll!WSARecv
0x71ab2e96 WS2_32.dll!htons
0x71ab373e WS2_32.dll!WSALookupServiceBeginW
0x71ab3673 WS2_32.dll!WSALookupServiceBeginW
0x71ab6104 WS2_32.dll!WSALookupServiceNextA
0x71ab9c2f WS2_32.dll!WSAStringToAddressA
0x71ab5e58 WS2_32.dll!WSALookupServiceNextA
0x71ab5ddc WS2_32.dll!WSALookupServiceNextA
0x00401175 test.exe!wmain
test.cpp:75
_Original issue: http://code.google.com/p/drmemory/issues/detail?id=436_
Contributor guide
Assessment
This issue has not been assessed yet.