From 6d5400a2c701125c71d907988ef57130c038759c Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Tue, 30 Apr 2024 15:55:01 +0100
Subject: [PATCH 1/1] ITS#10204 slapo-constraint: fix double-free on invalid
 attr

Reference:https://git.openldap.org/openldap/openldap/-/commit/6d5400a2c701125c71d907988ef57130c038759c
Conflict:NA

---
 servers/slapd/overlays/constraint.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/servers/slapd/overlays/constraint.c b/servers/slapd/overlays/constraint.c
index 0d6156af4d..9622c29929 100644
--- a/servers/slapd/overlays/constraint.c
+++ b/servers/slapd/overlays/constraint.c
@@ -369,6 +369,7 @@ constraint_cf_gen( ConfigArgs *c )
 						ap.attrs[i] = NULL;
 						if ( slap_str2ad( ap.lud->lud_attrs[i], &ap.attrs[i], &text ) ) {
 							ch_free( ap.attrs );
+							ap.attrs = NULL;
 							snprintf( c->cr_msg, sizeof( c->cr_msg ),
 								"%s <%s>: %s\n", c->argv[0], ap.lud->lud_attrs[i], text );
 							rc = ARG_BAD_CONF;
-- 
2.33.0

