From: Luke Howard Date: Sun, 31 Jul 2005 14:17:36 +0000 (+0000) Subject: Fix slapi_dn_beparent() behaviour (again) X-Git-Tag: OPENLDAP_AC_BP~130 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2b5cf310e6518ffc542012b5d67dd08dee6d8bae;p=openldap Fix slapi_dn_beparent() behaviour (again) --- diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 1b65c54d8f..4617359318 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -952,6 +952,8 @@ char *slapi_dn_beparent( Slapi_PBlock *pb, const char *_dn ) return NULL; } + PBLOCK_ASSERT_OP( pb, 0 ); + if ( slapi_is_rootdse( _dn ) ) { return NULL; } @@ -963,7 +965,7 @@ char *slapi_dn_beparent( Slapi_PBlock *pb, const char *_dn ) return NULL; } - be = select_backend( &dn, 0, 0 ); + be = select_backend( &pb->pb_op->o_req_ndn, 0, 0 ); if ( be == NULL || be_issuffix( be, &normalizedDN ) == 0 ) { dnParent( &prettyDN, &parentDN ); @@ -972,8 +974,8 @@ char *slapi_dn_beparent( Slapi_PBlock *pb, const char *_dn ) parent = slapi_ch_strdup( parentDN.bv_val ); } - slapi_ch_free( (void **)&prettyDN.bv_val ); - slapi_ch_free( (void **)&normalizedDN.bv_val ); + slapi_ch_free_string( &prettyDN.bv_val ); + slapi_ch_free_string( &normalizedDN.bv_val ); return parent; }