Calling ERR_clear_error() releases the buffers that hold the path/filename, so we need to push those to Lua (which will copy them) before they are released.
The problem can be verified with valgrind, or indeed just by running it on my machine which shows random memory contents prefixed to the error message string.
Calling
ERR_clear_error()
releases the buffers that hold the path/filename, so we need to push those to Lua (which will copy them) before they are released.The problem can be verified with valgrind, or indeed just by running it on my machine which shows random memory contents prefixed to the error message string.