mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-03 04:21:10 -05:00
ITS#9995 ldapdelete: plug potential search leak
This commit is contained in:
parent
3c284d26cd
commit
7f0e4ecdaa
1 changed files with 7 additions and 5 deletions
|
|
@ -389,7 +389,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 );
|
||||
|
|
@ -405,15 +407,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 ) {
|
||||
|
|
@ -424,7 +425,7 @@ more:;
|
|||
if ( rc != LDAP_SUCCESS ) {
|
||||
tool_perror( "ldap_delete", rc, NULL, NULL, NULL, NULL );
|
||||
ber_memfree( dn );
|
||||
return rc;
|
||||
goto leave;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -436,6 +437,7 @@ more:;
|
|||
}
|
||||
}
|
||||
|
||||
leave:
|
||||
ldap_msgfree( res );
|
||||
|
||||
if ( srch_rc == LDAP_SIZELIMIT_EXCEEDED ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue