aboutsummaryrefslogtreecommitdiffstats
path: root/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'mem.c')
-rw-r--r--mem.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mem.c b/mem.c
index dda95d6..baa7977 100644
--- a/mem.c
+++ b/mem.c
@@ -14,3 +14,13 @@ void *xmalloc(size_t size)
}
return rtn;
}
+
+void *xrealloc(void *p, size_t size)
+{
+ void *pmem = realloc(p, size);
+
+ if (!pmem)
+ free(p);
+
+ return pmem;
+}