This violates the guarantee in include/mempool.h which states:
o To ensure a stack can be unwound at any time in a multi-threaded process (e.g., even at a time when the normal malloc-lock is taken, possibly by the very thread that is
being unwind).
Could you consider allocating memory statically for the path or if you must do it dynamically, use mempools?