diff --git a/contrib/slapd-modules/allowed/allowed.c b/contrib/slapd-modules/allowed/allowed.c index a01cf83129..776743b9a8 100644 --- a/contrib/slapd-modules/allowed/allowed.c +++ b/contrib/slapd-modules/allowed/allowed.c @@ -268,7 +268,7 @@ aa_operational( Operation *op, SlapReply *rs ) ch_free( ocp ); - if ( atp != NULL ) { + if ( atp != NULL && atp[0] != NULL ) { BerVarray bv_allowed = NULL, bv_effective = NULL; int i, ja = 0, je = 0; @@ -323,8 +323,10 @@ aa_operational( Operation *op, SlapReply *rs ) (*ap)->a_nvals = bv_effective; (*ap)->a_numvals = je; ap = &(*ap)->a_next; + bv_effective = NULL; } + ch_free( bv_effective ); *ap = NULL; } @@ -409,8 +411,10 @@ done_ce:; (*ap)->a_nvals = bv_effective; (*ap)->a_numvals = je; ap = &(*ap)->a_next; + bv_effective = NULL; } + ch_free( bv_effective ); *ap = NULL; }