CPU (Windows): fix possible memory errors

This commit is contained in:
李通洲
2023-09-07 17:03:24 +08:00
parent d8b2151143
commit fe9fcd603b
+1 -1
View File
@@ -35,7 +35,7 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
return "GetLogicalProcessorInformationEx(RelationAll, pProcessorInfo, &length) failed";
}
FF_HKEY_AUTO_DESTROY hKey;
FF_HKEY_AUTO_DESTROY hKey = NULL;
if(!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", &hKey, NULL))
return "ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L\"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0\", &hKey, NULL) failed";