Friday, March 27, 2020

[389-commits] [389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 50984 - Memory leaks in disk monitoring

This is an automated email from the git hooks/post-receive script.

spichugi pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.

The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new e56a2fa Issue 50984 - Memory leaks in disk monitoring
e56a2fa is described below

commit e56a2fad745d8875b2ed9985b1d9cbfcdb40f77b
Author: Simon Pichugin <spichugi@redhat.com>
AuthorDate: Thu Mar 26 19:33:47 2020 +0100

Issue 50984 - Memory leaks in disk monitoring

Description: Memory leaks are reported by the disk monitoring test suite.
The direct leak is related to char **dirs array which is not freed at all.
Free the array when we clean up or go to shutdown.

https://pagure.io/389-ds-base/issue/50984

Reviewed by: firstyear, tbordaz (Thanks!)
---
ldap/servers/slapd/daemon.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index 7c6d35f..e6aca97 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -489,8 +489,7 @@ disk_monitoring_thread(void *nothing __attribute__((unused)))
slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread",
"Disk space is critically low on disk (%s), remaining space: %" PRIu64 " Kb. Signaling slapd for shutdown...\n",
dirstr, (disk_space / 1024));
- g_set_shutdown(SLAPI_SHUTDOWN_DISKFULL);
- return;
+ goto cleanup;
}
/*
* If we are low, see if we are using verbose error logging, and turn it off
@@ -558,6 +557,8 @@ disk_monitoring_thread(void *nothing __attribute__((unused)))
now = start;
while ((now - start) < grace_period) {
if (g_get_shutdown()) {
+ slapi_ch_array_free(dirs);
+ dirs = NULL;
return;
}
/*
@@ -600,8 +601,7 @@ disk_monitoring_thread(void *nothing __attribute__((unused)))
slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread",
"Disk space is critically low on disk (%s), remaining space: %" PRIu64 " Kb. Signaling slapd for shutdown...\n",
dirstr, (disk_space / 1024));
- g_set_shutdown(SLAPI_SHUTDOWN_DISKFULL);
- return;
+ goto cleanup;
}
now = slapi_current_utc_time();
}
@@ -618,11 +618,14 @@ disk_monitoring_thread(void *nothing __attribute__((unused)))
slapi_log_err(SLAPI_LOG_ALERT, "disk_monitoring_thread",
"Disk space is still too low (%" PRIu64 " Kb). Signaling slapd for shutdown...\n",
(disk_space / 1024));
- g_set_shutdown(SLAPI_SHUTDOWN_DISKFULL);
-
- return;
+ goto cleanup;
}
}
+ cleanup:
+ slapi_ch_array_free(dirs);
+ dirs = NULL;
+ g_set_shutdown(SLAPI_SHUTDOWN_DISKFULL);
+ return;
}

static void

--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/389-commits@lists.fedoraproject.org

No comments:

Post a Comment