From: Arthur Miller Date: Tue, 21 Jan 2025 18:10:14 +0000 (+0100) Subject: Fix bug in w32_memory_info X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~106 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=58d3d4820ad327f07cea5894a9675bf30553461e;p=emacs.git Fix bug in w32_memory_info * src/w32.c (w32_memory_info): Initialize struct size. --- diff --git a/src/w32.c b/src/w32.c index 6399d883544..0d876951cf6 100644 --- a/src/w32.c +++ b/src/w32.c @@ -7659,7 +7659,7 @@ w32_memory_info (unsigned long long *totalram, unsigned long long *freeram, { 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)) @@ -7670,7 +7670,9 @@ w32_memory_info (unsigned long long *totalram, unsigned long long *freeram, *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;