summaryrefslogtreecommitdiff
path: root/openbsd-compat/freezero.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2018-02-16 17:32:28 +1100
committerDarren Tucker <dtucker@dtucker.net>2018-02-16 17:33:29 +1100
commitf6dc2ba3c9d12be53057b9371f5109ec553a399f (patch)
tree834f908a80ce4f3cf4f04e683aecaa475697daa9 /openbsd-compat/freezero.c
parent680321f3eb46773883111e234b3c262142ff7c5b (diff)
freezero should check for NULL.
Diffstat (limited to 'openbsd-compat/freezero.c')
-rw-r--r--openbsd-compat/freezero.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsd-compat/freezero.c b/openbsd-compat/freezero.c
index ca5de785b..90b9d3813 100644
--- a/openbsd-compat/freezero.c
+++ b/openbsd-compat/freezero.c
@@ -23,6 +23,8 @@
23void 23void
24freezero(void *ptr, size_t sz) 24freezero(void *ptr, size_t sz)
25{ 25{
26 if (ptr == NULL)
27 return;
26 explicit_bzero(ptr, sz); 28 explicit_bzero(ptr, sz);
27 free(ptr); 29 free(ptr);
28} 30}