lc = ldap_back_getconn( op, rs, LDAP_BACK_SENDERR );
if ( !lc || !ldap_back_dobind( lc, op, rs, LDAP_BACK_SENDERR ) ) {
- rc = -1;
- goto cleanup;
+ return rs->sr_err;
}
ctrls = op->o_ctrls;
rc = ldap_back_proxy_authz_ctrl( lc, op, rs, &ctrls );
if ( rc != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
- rc = -1;
+ rc = rs->sr_err;
goto cleanup;
}
cleanup:
(void)ldap_back_proxy_authz_ctrl_free( op, &ctrls );
+ if ( lc != NULL ) {
+ ldap_back_release_conn( op, rs, lc );
+ }
+
return rc;
}