aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-02-16 14:20:31 +0100
committerRiccardo Spagni <ric@spagni.net>2018-02-16 14:20:31 +0100
commit666a76652bcc82c5f85e1a658eab83b27e9e78a4 (patch)
tree7ef0770f47b0c4a691b4cbe2d9849ecbc8fa202c /contrib
parentMerge pull request #3184 (diff)
parentcall _exit instead of abort in release mode (diff)
downloadmonero-666a76652bcc82c5f85e1a658eab83b27e9e78a4.tar.xz
Merge pull request #3187
851bd057 call _exit instead of abort in release mode (moneromooo-monero)
Diffstat (limited to 'contrib')
-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;