https://bugs.openldap.org/show_bug.cgi?id=10013
--- Comment #1 from Ondřej Kuzník ondra@mistotebe.net --- back-ldap will pull controls from libldap and so it needs to pass them to ldap_controls_free, but anything in the overlay stack calling slap_add_ctrls will mark rs with REP_CTRLS_MUSTBEFREED and start freeing the controls itself. That's going to leak the strings/values associated with the controls.
Either we need to divorce the internal slapd control structure from LDAPControl so we can take a note how to drop it or make it everyone's responsibility to free their own control (and anything else associated with it) if they attached it to the response.