summaryrefslogtreecommitdiff
path: root/xmalloc.h
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-06-15 18:42:03 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-06-15 18:42:03 +0200
commit5bc9299f0d1b0baf220b75da86520606e87c4b3a (patch)
treefb520a3b34349fb588171ce85bb274d0b948d04b /xmalloc.h
parentb7609f8d52cc2dbd1b3b2c08e95e7529368a951c (diff)
curve: simplify curve25519_proto_init and others
Simplify the function curve25519_proto_init() and also have minor cleanups in other related ones. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
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); \