Closed katshup closed 4 months ago
Thank you for the PR. However, the double free is not harmful so there is no real reason to abort. It is also better to modify the test in init.c
,
#if (MI_SECURE>0)
if (err==EFAULT) { // abort on serious errors in secure mode (corrupted meta-data)
abort();
}
#endif
to include EAGAIN
? Moreover, you can have custom behavior by registering your own error handler through mi_register_error
to abort in all cases in secure mode.
Hope that makes sense, best.
In secure mode the library should be aborting on double free instead of swallowing the error. The idea being that you want to err on the side of caution instead of letting the program continue.