aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/src')
-rw-r--r--contrib/epee/src/memwipe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/epee/src/memwipe.c b/contrib/epee/src/memwipe.c
index 870c69757..9a83e67e8 100644
--- a/contrib/epee/src/memwipe.c
+++ b/contrib/epee/src/memwipe.c
@@ -31,6 +31,7 @@
#define __STDC_WANT_LIB_EXT1__ 1
#include <string.h>
#include <stdlib.h>
+#include <unistd.h>
#ifdef HAVE_EXPLICIT_BZERO
#include <strings.h>
#endif
@@ -50,7 +51,12 @@ void *memwipe(void *ptr, size_t n)
{
if (memset_s(ptr, n, 0, n))
{
+#ifdef NDEBUG
+ fprintf(stderr, "Error: memset_s failed\n");
+ _exit(1);
+#else
abort();
+#endif
}
SCARECROW // might as well...
return ptr;