This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.0
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.0 by this push:
new 85c3c30 Ticket 50308 - Fix memory leaks for repeat binds and replication
85c3c30 is described below
commit 85c3c304b4f247dbd6521cd8ca6e7840bcc212bb
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Thu Mar 28 18:15:10 2019 -0400
Ticket 50308 - Fix memory leaks for repeat binds and replication
Description: Fixed two memory leaks:
- If a worker thread had multiple binds the "bind dn"
thread data was leaked.
- Memory leak when processing changes in the changelog
https://pagure.io/389-ds-base/issue/50308
Reviewed by: firstyear(Thanks!)
(cherry picked from commit 6c2bb66f15d7ab8ab079effc66e0705c2513b1fd)
---
ldap/servers/plugins/replication/cl5_clcache.c | 9 ++++++---
ldap/servers/slapd/thread_data.c | 2 ++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/ldap/servers/plugins/replication/cl5_clcache.c
b/ldap/servers/plugins/replication/cl5_clcache.c
index a8477a8..6c18829 100644
--- a/ldap/servers/plugins/replication/cl5_clcache.c
+++ b/ldap/servers/plugins/replication/cl5_clcache.c
@@ -589,6 +589,7 @@ clcache_refresh_local_maxcsn(const ruv_enum_data *rid_data, void
*data)
/* this is the first time we have a local change for the RID
* we need to check what the consumer knows about it.
*/
+ csn_free(&buf->buf_cscbs[i]->consumer_maxcsn);
ruv_get_largest_csn_for_replica(
buf->buf_consumer_ruv,
buf->buf_cscbs[i]->rid,
@@ -832,6 +833,7 @@ clcache_skip_change(CLC_Buffer *buf)
/* Send CSNs that are covered by the local RUV snapshot */
if (csn_compare(buf->buf_current_csn, cscb->local_maxcsn) <= 0) {
skip = 0;
+ csn_free(&cscb->consumer_maxcsn);
csn_dup_or_init_by_csn(&cscb->consumer_maxcsn,
buf->buf_current_csn);
break;
}
@@ -842,11 +844,12 @@ clcache_skip_change(CLC_Buffer *buf)
* are not sure if current_csn is the neighbor.
*/
if (csn_time_difference(buf->buf_current_csn, cscb->local_maxcsn) == 0
&&
- (csn_get_seqnum(buf->buf_current_csn) ==
- csn_get_seqnum(cscb->local_maxcsn) + 1)) {
+ (csn_get_seqnum(buf->buf_current_csn) ==
csn_get_seqnum(cscb->local_maxcsn) + 1))
+ {
csn_init_by_csn(cscb->local_maxcsn, buf->buf_current_csn);
if (cscb->consumer_maxcsn) {
- csn_init_by_csn(cscb->consumer_maxcsn, buf->buf_current_csn);
+ csn_free(&cscb->consumer_maxcsn);
+ csn_dup_or_init_by_csn(cscb->consumer_maxcsn,
buf->buf_current_csn);
}
skip = 0;
break;
diff --git a/ldap/servers/slapd/thread_data.c b/ldap/servers/slapd/thread_data.c
index 7babe36..fb9951d 100644
--- a/ldap/servers/slapd/thread_data.c
+++ b/ldap/servers/slapd/thread_data.c
@@ -98,6 +98,8 @@ slapi_td_get_plugin_locked()
int32_t
slapi_td_set_dn(char *value)
{
+ char *dn = pthread_getspecific(td_requestor_dn);
+ slapi_ch_free_string(&dn);
if (pthread_setspecific(td_requestor_dn, value) != 0) {
return PR_FAILURE;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.