X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=misc.c;h=6f2d5448dee146ede4d7111fc08455cc2d152c32;hb=030c75b7db19c25dd59aa8dc40bc906b737761ec;hp=a2d741e54cbdbf5412ff5311f08c205d32d5e4f2;hpb=4f33c36ff5b56846a496ff952d35efebc0c0bd08;p=PuTTY.git diff --git a/misc.c b/misc.c index a2d741e5..6f2d5448 100644 --- a/misc.c +++ b/misc.c @@ -294,7 +294,7 @@ static void *minefield_alloc(int size) /* * Update the admin region. */ - for (i = start + 2; i < start + npages - 1; i++) + for (i = start + 2; i < start + npages + 1; i++) minefield_admin[i] = 0xFFFE; /* used but no region starts here */ minefield_admin[start + 1] = region_start % PAGESIZE; @@ -415,7 +415,7 @@ void *safemalloc(size_t size) #endif MessageBox(NULL, str, "PuTTY Fatal Error", MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); - exit(1); + cleanup_exit(1); } #ifdef MALLOC_LOG if (fp) @@ -452,7 +452,7 @@ void *saferealloc(void *ptr, size_t size) #endif MessageBox(NULL, str, "PuTTY Fatal Error", MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); - exit(1); + cleanup_exit(1); } #ifdef MALLOC_LOG if (fp)