stgReallocBytes(DEBUG): don't fail when the ptr passed in is NULL
authorSimon Marlow <marlowsd@gmail.com>
Tue, 17 Aug 2010 15:08:36 +0000 (15:08 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 17 Aug 2010 15:08:36 +0000 (15:08 +0000)
rts/RtsUtils.c

index eee7594..e9da59f 100644 (file)
@@ -219,7 +219,7 @@ stgReallocBytes (void *p, int n, char *msg)
       stg_exit(EXIT_INTERNAL_ERROR);
     }
 #if defined(DEBUG)
-    removeAllocation(p, 0);
+    if (p != NULL) { removeAllocation(p, 0); }
     addAllocation(space, n2);
 #endif
     return space;