[Git][openldap/openldap][master] ITS#10151 Make sure we release scratch objects on "error"