mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 18:18:06 -05:00
ITS#9995 ldapdelete: plug potential search leak
This commit is contained in:
parent
bc7c267f70
commit
8169359944
1 changed files with 7 additions and 5 deletions
|
|
@ -386,7 +386,9 @@ more:;
|
|||
break;
|
||||
default:
|
||||
tool_perror( "ldap_search", srch_rc, NULL, NULL, NULL, NULL );
|
||||
return( srch_rc );
|
||||
rc = srch_rc;
|
||||
srch_rc = 0;
|
||||
goto leave;
|
||||
}
|
||||
|
||||
entries = ldap_count_entries( ld, res );
|
||||
|
|
@ -402,15 +404,14 @@ more:;
|
|||
if( dn == NULL ) {
|
||||
ldap_get_option( ld, LDAP_OPT_RESULT_CODE, &rc );
|
||||
tool_perror( "ldap_prune", rc, NULL, NULL, NULL, NULL );
|
||||
ber_memfree( dn );
|
||||
return rc;
|
||||
goto leave;
|
||||
}
|
||||
|
||||
rc = deletechildren( ld, dn, 0 );
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
tool_perror( "ldap_prune", rc, NULL, NULL, NULL, NULL );
|
||||
ber_memfree( dn );
|
||||
return rc;
|
||||
goto leave;
|
||||
}
|
||||
|
||||
if ( verbose ) {
|
||||
|
|
@ -421,7 +422,7 @@ more:;
|
|||
if ( rc != LDAP_SUCCESS ) {
|
||||
tool_perror( "ldap_delete", rc, NULL, NULL, NULL, NULL );
|
||||
ber_memfree( dn );
|
||||
return rc;
|
||||
goto leave;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -433,6 +434,7 @@ more:;
|
|||
}
|
||||
}
|
||||
|
||||
leave:
|
||||
ldap_msgfree( res );
|
||||
|
||||
if ( srch_rc == LDAP_SIZELIMIT_EXCEEDED ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue