We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94abcc8 commit c5946a1Copy full SHA for c5946a1
runtime/vm/cpuinfo_win.cc
@@ -50,7 +50,11 @@ void CpuInfo::Cleanup() {
50
51
bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) {
52
if (method_ == kCpuInfoCpuId) {
53
- return CpuId::field(idx);
+ const char* field = CpuId::field(idx);
54
+ if (field == nullptr) return false;
55
+ bool contains = (strstr(field, search_string) != nullptr);
56
+ free(const_cast<char*>(field));
57
+ return contains;
58
} else {
59
UNREACHABLE();
60
}
0 commit comments