about summary refs log tree commit diff stats
path: root/src/custommem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/custommem.c')
-rw-r--r--src/custommem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/custommem.c b/src/custommem.c
index c11e1557..b2b5d6a5 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -892,7 +892,7 @@ void addMapMem(uintptr_t begin, uintptr_t end)
         newm->end = end;
         m->next = newm;
     }
-    while(newm->next && (newm->next->begin-1)<=newm->end) {
+    while(newm && newm->next && (newm->next->begin-1)<=newm->end) {
         // fuse with next
         if(newm->next->end>newm->end)
             newm->end = newm->next->end;