Author: mladen.turk(a)jboss.com
Date: 2007-09-06 14:04:47 -0400 (Thu, 06 Sep 2007)
New Revision: 984
Modified:
trunk/sight/native/os/windows/process.c
Log:
Bail out if alloc fails
Modified: trunk/sight/native/os/windows/process.c
===================================================================
--- trunk/sight/native/os/windows/process.c 2007-09-06 15:51:07 UTC (rev 983)
+++ trunk/sight/native/os/windows/process.c 2007-09-06 18:04:47 UTC (rev 984)
@@ -246,8 +246,10 @@
SIZE_T nrd, rdd;
for (i = 0; i < 2; i++) {
- pages[i].len = 0;
- pages[i].str.w = NULL;
+ pages[i].len = 0;
+ pages[i].str.w = NULL;
+ }
+ for (i = 0; i < 2; i++) {
if (!VirtualQueryEx(hProcess, PEB_ADDRESS(i), &mbi, sizeof(mbi)))
continue;
nrd = mbi.RegionSize;
@@ -255,9 +257,10 @@
if (nrd > 8192)
continue;
pages[i].str.w = apr_palloc(pool, nrd);
- if (!pages[i].str.w)
- continue;
-
+ if (!pages[i].str.w) {
+ /* If we cannot alloc memory what's the point? */
+ return;
+ }
if (!ReadProcessMemory(hProcess,
PEB_ADDRESS(i),
pages[i].str.w,
Show replies by date