Blame SOURCES/0008-Issue-5397-Fix-various-memory-leaks.patch

a77461
From 877df07df2e41988a797778b132935b7d8acfd87 Mon Sep 17 00:00:00 2001
a77461
From: Mark Reynolds <mreynolds@redhat.com>
a77461
Date: Fri, 5 Aug 2022 14:07:18 -0400
a77461
Subject: [PATCH 4/5] Issue 5397 - Fix various memory leaks
a77461
a77461
Description:
a77461
a77461
Fixed memory leaks in:
a77461
a77461
- Filter optimizer introduced sr_norm_filter_intent which dupped a filter
a77461
  but never freed it.
a77461
- Replication connections would leak the replication manager's
a77461
  credentials.
a77461
a77461
relates: https://github.com/389ds/389-ds-base/issues/5397
a77461
a77461
Reviewed by: progier & jchapman (Thanks!!)
a77461
---
a77461
 ldap/servers/plugins/replication/repl5_connection.c | 1 +
a77461
 ldap/servers/slapd/back-ldbm/ldbm_search.c          | 1 +
a77461
 2 files changed, 2 insertions(+)
a77461
a77461
diff --git a/ldap/servers/plugins/replication/repl5_connection.c b/ldap/servers/plugins/replication/repl5_connection.c
a77461
index b6bc21c46..be8bba08e 100644
a77461
--- a/ldap/servers/plugins/replication/repl5_connection.c
a77461
+++ b/ldap/servers/plugins/replication/repl5_connection.c
a77461
@@ -247,6 +247,7 @@ conn_delete_internal(Repl_Connection *conn)
a77461
     slapi_ch_free_string(&conn->last_ldap_errmsg);
a77461
     slapi_ch_free((void **)&conn->hostname);
a77461
     slapi_ch_free((void **)&conn->binddn);
a77461
+    slapi_ch_free((void **)&conn->creds);
a77461
     slapi_ch_free((void **)&conn->plain);
a77461
 }
a77461
 
a77461
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
a77461
index d0f52b6f7..771c35a33 100644
a77461
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
a77461
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
a77461
@@ -1930,6 +1930,7 @@ delete_search_result_set(Slapi_PBlock *pb, back_search_result_set **sr)
a77461
                       rc, filt_errs);
a77461
     }
a77461
     slapi_filter_free((*sr)->sr_norm_filter, 1);
a77461
+    slapi_filter_free((*sr)->sr_norm_filter_intent, 1);
a77461
     memset(*sr, 0, sizeof(back_search_result_set));
a77461
     slapi_ch_free((void **)sr);
a77461
     return;
a77461
-- 
a77461
2.37.1
a77461