diff options
author | Darren Tucker <dtucker@dtucker.net> | 2018-02-16 17:32:28 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2018-02-16 17:33:29 +1100 |
commit | f6dc2ba3c9d12be53057b9371f5109ec553a399f (patch) | |
tree | 834f908a80ce4f3cf4f04e683aecaa475697daa9 /openbsd-compat/freezero.c | |
parent | 680321f3eb46773883111e234b3c262142ff7c5b (diff) |
freezero should check for NULL.
Diffstat (limited to 'openbsd-compat/freezero.c')
-rw-r--r-- | openbsd-compat/freezero.c | 2 |
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 @@ | |||
23 | void | 23 | void |
24 | freezero(void *ptr, size_t sz) | 24 | freezero(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 | } |