So that's talloc, but the thing you really should know about talloc is right there at the bottom of the project page. In particular:
when using talloc_enable_leak_report(), giving directly NULL as a parent context implicitly refers to a hidden "null context" global variable, so this should not be used in a multi-threaded environment without proper synchronization.
I've spent many days recently hunting down a bug, the bug would have been much easier to find if I had read the above line. Suddenly I was sharing contexts all over the place and very very rarely there'd be a synchronization problem that would lead to a null pointer deref.
By the way talloc_enable_leak_report() is an excellent feature of talloc. Excellent.
Post a Comment