https://bugs.openldap.org/show_bug.cgi?id=10290
--- Comment #3 from Ondřej Kuzník ondra@mistotebe.net --- On Mon, Dec 09, 2024 at 02:34:43PM +0000, openldap-its@openldap.org wrote:
ch_free() will correctly free either.
On the contrary, objects allocated from inside op->o_tmpmemctx are not safe to free by anyone else (and ch_malloc()'d pointers can be freed by anyone so long as they share the same free() fallback). And slap_mods_free can't use it because it's not been passed enough information.
Luckily, syncrepl keeps two separate callbacks and there seems to be a way to maintain a stack-like ordering: overlay_callback_after_backover.
This is what MR!737 does here: https://git.openldap.org/openldap/openldap/-/merge_requests/737