https://bugs.openldap.org/show_bug.cgi?id=10290
--- Comment #2 from Howard Chu hyc@openldap.org --- (In reply to Ondřej Kuzník from comment #1)
Another note.
Even if code is changed for rwm/syncrepl try to cooperate despite the callback order being what it is, things go wrong anyway: rwm allocates its modlist with ch_malloc, syncrepl gets it from op->o_tmpmemctx. They cannot safely free each other's modlists, knowing nothing about what the right way to go about it would be.
ch_free() will correctly free either.