]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10349 Free bv_effective if unused
authorOndřej Kuzník <ondra@mistotebe.net>
Fri, 13 Jun 2025 07:01:55 +0000 (08:01 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 20 Jun 2025 14:52:19 +0000 (14:52 +0000)
contrib/slapd-modules/allowed/allowed.c

index a01cf8312933640d9745939632f2aa469adf2e4b..776743b9a8784631d81bb985866b5dfc99762e7a 100644 (file)
@@ -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;
        }