-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Networking
-
Labels:
-
ALL
-
Security 2019-02-25
Leak of memory or pointers to system resources
Defect 111241 (STATIC_C)
Checker RESOURCE_LEAK (subcategory none)
File: /src/mongo/util/net/hostname_canonicalization.cpp
Function mongo::getHostFQDNs(std::basic_string<char, std::char_traits<char>, std::allocator<char>>, mongo::HostnameCanonicalizationMode)
/src/mongo/util/net/hostname_canonicalization.cpp, line: 92
"shim_getaddrinfo" allocates memory that is stored into "info". (The function pointer resolves to "getaddrinfo".)
if ((err = shim_getaddrinfo(nativeHostName.c_str(), nullptr, &hints, &info)) != 0) {
/src/mongo/util/net/hostname_canonicalization.cpp, line: 101
Variable "info" going out of scope leaks the storage it points to.
return results;