Ticket 48891 ns-slapd crashes during the shutdown after adding attribute with a matching rule
Bug Description:
This is a followup of a previous fix of the same ticket
During shutdown, plugin close callback is called AND plugins
structures are freed (plugin_closeall).
Free of these structure in plugin_closeall was done to avoid
noise from valgrind (https://fedorahosted.org/389/ticket/47645).
Later, freeing backends (be_cleanupall) calls the plugins cleanup
callback.
The problem is that plugin structure have already been freed and
cleanup callback can be an invalid pointer.
Fix Description:
The free of plugins structure is postponed after plugin_closeall
and be_cleanup with a new function plugin_dependency_freeall.
The fix also fixes a leak in plugin_dependency_startall.
https://fedorahosted.org/389/ticket/48891
Reviewed by: Mark Reynolds and Noriko Hosoi (thanks to you !!)
Platforms tested: F23
Flag Day: no
Doc impact: no