aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src/memwipe.c
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-01-26 10:35:13 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-02-01 13:32:46 +0000
commit851bd057ecfa2997252429f86362b0a710a1af8d (patch)
treeee07556385050124c85bcc76fea1cb1b81da65c5 /contrib/epee/src/memwipe.c
parentMerge pull request #3130 (diff)
downloadmonero-851bd057ecfa2997252429f86362b0a710a1af8d.tar.xz
call _exit instead of abort in release mode
Avoids cores being created, as they're nowadays often piped to some call home system
Diffstat (limited to '')
-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 da7e9f346..423eb89fb 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;