* src/w32.c (w32_memory_info): Initialize struct size.
{
MEMORYSTATUS memst;
MEMORY_STATUS_EX memstex;
-
+ memstex.dwLength = sizeof(memstex);
/* Use GlobalMemoryStatusEx if available, as it can report more than
2GB of memory. */
if (global_memory_status_ex (&memstex))
*freeswap = memstex.ullAvailPageFile;
return 0;
}
- else if (global_memory_status (&memst))
+
+ memst.dwLength = sizeof(memst);
+ if (global_memory_status (&memst))
{
*totalram = memst.dwTotalPhys;
*freeram = memst.dwAvailPhys;