summaryrefslogtreecommitdiff
path: root/xmalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'xmalloc.h')
-rw-r--r--xmalloc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmalloc.h b/xmalloc.h
index e1e4f8f..952b827 100644
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -24,6 +24,12 @@ static inline void __xfree(void *ptr)
free(ptr);
}
+#define xzfree(ptr, size) \
+do { \
+ xmemset(ptr, 0, size); \
+ xfree(ptr); \
+} while (0)
+
#define xfree(ptr) \
do { \
__xfree(ptr); \