int deleteoldrdn,
char *newSuperior )
{
- BerElement *ber;
-
/*
* A modify rdn request looks like this:
* ModifyRDNRequest ::= SEQUENCE {
Debug( LDAP_DEBUG_TRACE, "ldap_rename2\n", 0, 0, 0 );
- /* create a message to send */
- if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
- return( -1 );
- }
-
if( newSuperior != NULL ) {
+ BerElement *ber;
+
+ /* create a message to send */
+ if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
+ return( -1 );
+ }
if ( ber_printf( ber, "{it{ssbts}}",
++ld->ld_msgid,
strdup( ld->ld_defhost )) == NULL ))
{
if (srv != NULL) free( srv );
+ ber_free( ber, 1 );
ld->ld_errno = LDAP_NO_MEMORY;
return( -1 );
}
{
if ( ld->ld_defhost != NULL ) free( srv->lsrv_host );
free( (char *)srv );
+ ber_free( ber, 1 );
ld->ld_errno = LDAP_SERVER_DOWN;
return( -1 );
}
ld->ld_defport, &ld->ld_host, 0 ) < 0 )
{
ldap_ld_free( ld, 0 );
+ ber_free( ber, 1 );
ld->ld_errno = LDAP_SERVER_DOWN;
return( -1 );
}