]> git.sur5r.net Git - openldap/commitdiff
ITS#4805 plug remaining leak
authorHoward Chu <hyc@openldap.org>
Thu, 25 Jan 2007 07:10:34 +0000 (07:10 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 25 Jan 2007 07:10:34 +0000 (07:10 +0000)
servers/slapd/syncrepl.c

index aaf8ef26b03085156e2e367d2f3d2aae042ff199..164dfee15ff2fed7e42c49b33a3809c2a7ee2018 100644 (file)
@@ -1412,12 +1412,6 @@ syncrepl_message_to_entry(
                return rc;
        }
 
-       dnPrettyNormal( NULL, &bdn, &dn, &ndn, op->o_tmpmemctx );
-       ber_dupbv( &op->o_req_dn, &dn );
-       ber_dupbv( &op->o_req_ndn, &ndn );
-       slap_sl_free( ndn.bv_val, op->o_tmpmemctx );
-       slap_sl_free( dn.bv_val, op->o_tmpmemctx );
-
        if ( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_DELETE ) {
                /* NOTE: this could be done even before decoding the DN,
                 * although encoding errors wouldn't be detected */
@@ -1430,6 +1424,12 @@ syncrepl_message_to_entry(
                goto done;
        }
 
+       dnPrettyNormal( NULL, &bdn, &dn, &ndn, op->o_tmpmemctx );
+       ber_dupbv( &op->o_req_dn, &dn );
+       ber_dupbv( &op->o_req_ndn, &ndn );
+       slap_sl_free( ndn.bv_val, op->o_tmpmemctx );
+       slap_sl_free( dn.bv_val, op->o_tmpmemctx );
+
        e = entry_alloc();
        e->e_name = op->o_req_dn;
        e->e_nname = op->o_req_ndn;