diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-11-27 15:36:30 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-11-27 15:36:30 +0000 |
commit | a76a36915c7d348582f905629fa0840a88b02edb (patch) | |
tree | 4a0809a4bd1a8ee27af6f22d3dda04f37c292bb7 /frontends/amiga | |
parent | c4b8857789e3f79a2ae0f7abe108999bf323b01a (diff) | |
download | netsurf-a76a36915c7d348582f905629fa0840a88b02edb.tar.gz netsurf-a76a36915c7d348582f905629fa0840a88b02edb.tar.bz2 |
Ensure the memory for the mem-handler interrupt is allocated
Diffstat (limited to 'frontends/amiga')
-rwxr-xr-x | frontends/amiga/memory.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/frontends/amiga/memory.c b/frontends/amiga/memory.c index abf849db6..880131a7d 100755 --- a/frontends/amiga/memory.c +++ b/frontends/amiga/memory.c @@ -74,6 +74,7 @@ static ASM ULONG ami_memory_handler(REG(a0, struct MemHandlerData *mhd), REG(a1, struct Interrupt *ami_memory_init(void) { struct Interrupt *memhandler = malloc(sizeof(struct Interrupt)); + if(memhandler == NULL) return NULL; // we're screwed memhandler->is_Node.ln_Pri = 1; memhandler->is_Node.ln_Name = "NetSurf slab memory handler"; @@ -86,8 +87,10 @@ struct Interrupt *ami_memory_init(void) void ami_memory_fini(struct Interrupt *memhandler) { - RemMemHandler(memhandler); - free(memhandler); + if(memhandler != NULL) { + RemMemHandler(memhandler); + free(memhandler); + } } #endif |