From d878ebc3d264dcecb211cf7aacd9d079bd5c5a50 Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Tue, 15 Mar 2022 16:46:09 +0000
Subject: [PATCH] ITS#9802 slapd-meta: fix rewrite config SEGV

---
 servers/slapd/back-meta/config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c
index 51d090ff0..ad7fbce44 100644
--- a/servers/slapd/back-meta/config.c
+++ b/servers/slapd/back-meta/config.c
@@ -2662,9 +2662,9 @@ idassert-authzFrom	"dn:<rootdn>"
 						c->fname, c->lineno, ca.argc, ca.argv );
 				}
 				assert( rc == 0 );
-				ch_free( ca.argv );
 				ch_free( ca.tline );
 			}
+			ch_free( ca.argv );
 		}
 		argc = c->argc;
 		argv = c->argv;
@@ -2699,9 +2699,9 @@ idassert-authzFrom	"dn:<rootdn>"
 						c->fname, c->lineno, ca.argc, argv );
 				}
 				assert( rc == 0 );
-				ch_free( ca.argv );
 				ch_free( ca.tline );
 			}
+			ch_free( ca.argv );
 		}
 
 		/* save the rule info */
-- 
2.33.0

