mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
fix leak (ITS#4805)
This commit is contained in:
parent
1f853acfc9
commit
8b2e8ece5c
@ -1382,7 +1382,7 @@ syncrepl_message_to_entry(
|
||||
char txtbuf[SLAP_TEXT_BUFLEN];
|
||||
size_t textlen = sizeof txtbuf;
|
||||
|
||||
struct berval bdn = {0, NULL}, dn, ndn;
|
||||
struct berval bdn = BER_BVNULL, dn, ndn;
|
||||
int rc;
|
||||
|
||||
*modlist = NULL;
|
||||
@ -1397,7 +1397,6 @@ syncrepl_message_to_entry(
|
||||
op->o_tag = LDAP_REQ_ADD;
|
||||
|
||||
rc = ldap_get_dn_ber( si->si_ld, msg, &ber, &bdn );
|
||||
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"syncrepl_message_to_entry: rid %03ld dn get failed (%d)",
|
||||
@ -1412,13 +1411,15 @@ syncrepl_message_to_entry(
|
||||
slap_sl_free( dn.bv_val, op->o_tmpmemctx );
|
||||
|
||||
if ( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_DELETE ) {
|
||||
if ( entry )
|
||||
*entry = NULL;
|
||||
return LDAP_SUCCESS;
|
||||
/* NOTE: this could be done even before decoding the DN,
|
||||
* although encoding errors wouldn't be detected */
|
||||
rc = LDAP_SUCCESS;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ( entry == NULL ) {
|
||||
return -1;
|
||||
rc = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
e = entry_alloc();
|
||||
@ -1493,7 +1494,7 @@ syncrepl_message_to_entry(
|
||||
}
|
||||
|
||||
done:
|
||||
ber_free ( ber, 0 );
|
||||
ber_free( ber, 0 );
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
if ( e ) {
|
||||
entry_free( e );
|
||||
|
Loading…
Reference in New Issue
Block a user