]> git.sur5r.net Git - openldap/commitdiff
cleanup previous commit (thanks to Hallvard)
authorPierangelo Masarati <ando@openldap.org>
Tue, 30 Aug 2005 10:36:24 +0000 (10:36 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 30 Aug 2005 10:36:24 +0000 (10:36 +0000)
servers/slapd/back-meta/bind.c

index 0cb7f3337ea55c9f91f3b7fd243a4b2f5e4e34e6..7defb3d424f5f35bd5128c7e710ae8a177b7627d 100644 (file)
@@ -667,6 +667,7 @@ meta_back_op_result(
                                rerr = LDAP_SUCCESS;
        char                    *rmsg = NULL;
        char                    *rmatch = NULL;
+       void                    *rmatch_ctx = NULL;
 
        if ( candidate != META_TARGET_NONE ) {
                metasingleconn_t        *msc = &mc->mc_conns[ candidate ];
@@ -785,27 +786,17 @@ meta_back_op_result(
 
                ber_str2bv( rmatch, 0, 0, &dn );
                if ( dnPretty( NULL, &dn, &pdn, op->o_tmpmemctx ) == LDAP_SUCCESS ) {
-                       rs->sr_matched = pdn.bv_val;
                        ldap_memfree( rmatch );
-                       rmatch = NULL;
-               } else {
-                       rs->sr_matched = rmatch;
+                       rmatch_ctx = op->o_tmpmemctx;
+                       rmatch = pdn.bv_val;
                }
-
-       } else {
-               rs->sr_matched = NULL;
        }
        send_ldap_result( op, rs );
        if ( rmsg != NULL ) {
                ber_memfree( rmsg );
        }
-       if ( rs->sr_matched != NULL ) {
-               if ( rmatch == NULL ) {
-                       ber_memfree_x( rs->sr_matched, op->o_tmpmemctx );
-
-               } else {
-                       ldap_memfree( rmatch );
-               }
+       if ( rmatch != NULL ) {
+               ber_memfree_x( rmatch, rmatch_ctx );
                rs->sr_matched = NULL;
        }
        rs->sr_text = NULL;