From aecb51e1bbecef1872f9a3bb11856f39fa291f15 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 17 Aug 2010 15:08:36 +0000 Subject: [PATCH] stgReallocBytes(DEBUG): don't fail when the ptr passed in is NULL --- rts/RtsUtils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c index eee7594..e9da59f 100644 --- a/rts/RtsUtils.c +++ b/rts/RtsUtils.c @@ -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; -- 1.7.10.4