From 21981053a1195ae1555e23df4d9ac68d34ede9dd Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Sat, 28 Nov 2020 15:54:17 +0000
Subject: [PATCH] ITS#9408 fix vrfilter double-free

---
 servers/slapd/controls.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c
index 345531940..28fa64eb0 100644
--- a/servers/slapd/controls.c
+++ b/servers/slapd/controls.c
@@ -1578,7 +1578,10 @@ static int parseValuesReturnFilter (
 		} else {
 			send_ldap_result( op, rs );
 		}
-		if( op->o_vrFilter != NULL) vrFilter_free( op, op->o_vrFilter ); 
+		if( op->o_vrFilter != NULL) {
+			vrFilter_free( op, op->o_vrFilter );
+			op->o_vrFilter = NULL;
+		}
 	}
 #ifdef LDAP_DEBUG
 	else {
-- 
GitLab

