diff --git a/src/detection/memory/memory_windows.c b/src/detection/memory/memory_windows.c index ef3153843..d639c2a73 100644 --- a/src/detection/memory/memory_windows.c +++ b/src/detection/memory/memory_windows.c @@ -5,7 +5,11 @@ void ffDetectMemory(FFMemoryStorage* ram) MEMORYSTATUSEX statex = { .dwLength = sizeof(statex), }; - GlobalMemoryStatusEx(&statex); + if (!GlobalMemoryStatusEx(&statex)) + { + ffStrbufAppendS(&ram->error, "GlobalMemoryStatusEx() failed"); + return; + } ram->bytesTotal = statex.ullTotalPhys; ram->bytesUsed = statex.ullTotalPhys - statex.ullAvailPhys; } diff --git a/src/detection/swap/swap_windows.cpp b/src/detection/swap/swap_windows.cpp index 224a3ce35..d7f910f95 100644 --- a/src/detection/swap/swap_windows.cpp +++ b/src/detection/swap/swap_windows.cpp @@ -23,7 +23,7 @@ void ffDetectSwap(FFMemoryStorage* swap) { if(!(pstart = (SYSTEM_PAGEFILE_INFORMATION*)realloc(pstart, size))) { - ffStrbufAppendF(&swap->error, "relloc(pstart, %lu) failed", size); + ffStrbufAppendF(&swap->error, "realloc(pstart, %lu) failed", size); return; } }