From the main thread, we are using the usual memory contexts, which will exit the process if memory allocation/reallocation fails, while from the API thread we were mostly ignoring errors. This commit fixes it by setting custom memory management functions for libevent. These functions are simple wrappers over realloc() and will exit background worker on failure.
Coverage decreased (-1.01%) to 87.68% when pulling b15b0dc5972a199c900e7cbb3cf2b2ac806bdb00 on feature/safety into 011f6ab55793a06f3df13a2bcc4f5be7c1948d2e on master.
From the main thread, we are using the usual memory contexts, which will exit the process if memory allocation/reallocation fails, while from the API thread we were mostly ignoring errors. This commit fixes it by setting custom memory management functions for libevent. These functions are simple wrappers over realloc() and will exit background worker on failure.