From 1b18f682ed34f7d25b1837cbcf640ab329253b2e Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Tue, 4 Feb 2025 18:48:28 -0800
Subject: [PATCH] malloc() result check, suppress MSVC warning

---
 src/xpdev/netwrap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xpdev/netwrap.c b/src/xpdev/netwrap.c
index 0e6fc757d7..279b8c0f7b 100644
--- a/src/xpdev/netwrap.c
+++ b/src/xpdev/netwrap.c
@@ -66,7 +66,7 @@ str_list_t getNameServerList(void)
 		return NULL;
 	if (GetNetworkParams(FixedInfo, &FixedInfoLen) == ERROR_BUFFER_OVERFLOW) {
 		FixedInfo = (FIXED_INFO*)malloc(FixedInfoLen);
-		if (GetNetworkParams(FixedInfo, &FixedInfoLen) == ERROR_SUCCESS) {
+		if (FixedInfo != NULL && GetNetworkParams(FixedInfo, &FixedInfoLen) == ERROR_SUCCESS) {
 			ip = &FixedInfo->DnsServerList;
 			for (; ip != NULL; ip = ip->Next)
 				strListPush(&list, ip->IpAddress.String);
-- 
GitLab