From ea5c09d7c05e68d1b11e9d7d81df822c5e06df3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= Date: Wed, 15 Feb 2017 19:55:15 +0100 Subject: [PATCH] Report failure when malloc errors. --- src/debug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/debug.c b/src/debug.c index 9268ff6..38f0b1f 100644 --- a/src/debug.c +++ b/src/debug.c @@ -29,6 +29,9 @@ debug_breakpoint_add(rk65c02emu_t *e, uint16_t address) breakpoint_t *bp; bp = (breakpoint_t *) malloc(sizeof(breakpoint_t)); + if (bp == NULL) + return false; + bp->address = address; LL_APPEND((e->bps_head), bp);