diff options
author | kinichiro <kinichiro.inoguchi@gmail.com> | 2017-04-22 23:08:17 +0900 |
---|---|---|
committer | kinichiro <kinichiro.inoguchi@gmail.com> | 2017-04-22 23:37:20 +0900 |
commit | 048625cf2b36a91bcf04c5a1adc02fc5803491ca (patch) | |
tree | 5f328c5237ea412b17c7c7f3d5c8132115c7e790 /crypto/compat | |
parent | 9d2418ae3a0b9577fdea0bac90802d8c0147f7f4 (diff) | |
download | portable-048625cf2b36a91bcf04c5a1adc02fc5803491ca.tar.gz portable-048625cf2b36a91bcf04c5a1adc02fc5803491ca.tar.bz2 portable-048625cf2b36a91bcf04c5a1adc02fc5803491ca.zip |
Add freezero support
Diffstat (limited to 'crypto/compat')
-rw-r--r-- | crypto/compat/freezero.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/compat/freezero.c b/crypto/compat/freezero.c new file mode 100644 index 0000000..8becc00 --- /dev/null +++ b/crypto/compat/freezero.c | |||
@@ -0,0 +1,13 @@ | |||
1 | #include <string.h> | ||
2 | #include <stdlib.h> | ||
3 | |||
4 | void | ||
5 | freezero(void *ptr, size_t sz) | ||
6 | { | ||
7 | /* This is legal. */ | ||
8 | if (ptr == NULL) | ||
9 | return; | ||
10 | |||
11 | explicit_bzero(ptr, sz); | ||
12 | free(ptr); | ||
13 | } | ||