Skip to content
Snippets Groups Projects
Commit 1b18f682 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

malloc() result check, suppress MSVC warning

parent 3971fd18
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,7 @@ str_list_t getNameServerList(void) ...@@ -66,7 +66,7 @@ str_list_t getNameServerList(void)
return NULL; return NULL;
if (GetNetworkParams(FixedInfo, &FixedInfoLen) == ERROR_BUFFER_OVERFLOW) { if (GetNetworkParams(FixedInfo, &FixedInfoLen) == ERROR_BUFFER_OVERFLOW) {
FixedInfo = (FIXED_INFO*)malloc(FixedInfoLen); FixedInfo = (FIXED_INFO*)malloc(FixedInfoLen);
if (GetNetworkParams(FixedInfo, &FixedInfoLen) == ERROR_SUCCESS) { if (FixedInfo != NULL && GetNetworkParams(FixedInfo, &FixedInfoLen) == ERROR_SUCCESS) {
ip = &FixedInfo->DnsServerList; ip = &FixedInfo->DnsServerList;
for (; ip != NULL; ip = ip->Next) for (; ip != NULL; ip = ip->Next)
strListPush(&list, ip->IpAddress.String); strListPush(&list, ip->IpAddress.String);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment