Commit 026d281c authored by Richard W.M. Jones's avatar Richard W.M. Jones
Browse files

lib: Don't leak thread-local storage for errors on dlclose or exit

If the destructor errors_free() is called, it deletes the thread-local
storage storing the last error message in the thread.  However this
doesn't call the destructor which was registered when the key was
created.  We have to delete that by hand on this path.

Note that we still have the valgrind suppression for this memory leak.
That is because in highly multi-threaded programs where one thread
calls exit, there's no guarantee that this destructor is called (in
fact, it's unlikely) so the memory would still appear to be leaked to
valgrind.
parent f9257a9f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment