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

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