Today, every caller of packet_realloc simply assumes that the allocation always succeeds. *Not* crashing outright on allocation failure makes diagnosing problems more difficult.
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com --- programs/winedbg/gdbproxy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index 522e4fdb506..deb6b0973f5 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -708,9 +708,8 @@ enum packet_return {packet_error = 0x00, packet_ok = 0x01, packet_done = 0x02, static char* packet_realloc(char* buf, int size) { if (!buf) - return HeapAlloc(GetProcessHeap(), 0, size); - return HeapReAlloc(GetProcessHeap(), 0, buf, size); - + return HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, size); + return HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, buf, size); }
static void packet_reply_grow(struct gdb_context* gdbctx, size_t size)