From b4ed8cf7839597a853eebe0261a86d8cbc6f70f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Fri, 13 Jun 2025 08:01:55 +0100 Subject: [PATCH] ITS#10349 Free bv_effective if unused --- contrib/slapd-modules/allowed/allowed.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.47.2