call _exit instead of abort in release mode

Avoids cores being created, as they're nowadays often piped
to some call home system
This commit is contained in:
moneromooo-monero 2018-01-26 10:35:13 +00:00
parent 09d19c9139
commit 851bd057ec
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
6 changed files with 49 additions and 7 deletions

View file

@ -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;