aboutsummaryrefslogtreecommitdiff
path: root/lib/cmyth/librefmem/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cmyth/librefmem/alloc.c')
-rw-r--r--lib/cmyth/librefmem/alloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/cmyth/librefmem/alloc.c b/lib/cmyth/librefmem/alloc.c
index e393f3eb50..af19ac6d39 100644
--- a/lib/cmyth/librefmem/alloc.c
+++ b/lib/cmyth/librefmem/alloc.c
@@ -283,7 +283,8 @@ ref_realloc(void *p, size_t len)
refmem_dbg(REF_DBG_DEBUG, "%s(%d, ret = %p, ref = %p) {\n",
__FUNCTION__, len, ret, ref);
#ifdef DEBUG
- assert(ref->magic == ALLOC_MAGIC);
+ if(p)
+ assert(ref->magic == ALLOC_MAGIC);
#endif /* DEBUG */
if (p && ret) {
memcpy(ret, p, ref->length);