This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch master
in repository 389-ds-base.
The following commit(s) were added to refs/heads/master by this push:
new 2ca86fe Ticket 50340 - 2nd try - structs for diabled plugins will not be freed
2ca86fe is described below
commit 2ca86fe13e0efa224fbe4f374be692a8ddabdeb7
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
AuthorDate: Thu May 23 11:11:25 2019 +0000
Ticket 50340 - 2nd try - structs for diabled plugins will not be freed
Bug: when plugins are loaded from dse.ldif enabled plugins will be added to
the list of the plugin type and freed when plugins are stopped.
But the memory allocated for disabled plugins will remain allocated and
and be reported.
Fix: The previous fix did free not enabled plugins in plugin_setup, but
that caused a lot of issues.
This patch frees not enabled plugins in plugin_dependency_freeall
Reviewed by: ?
Signed-off-by: Mark Reynolds <mreynolds(a)redhat.com>
---
ldap/servers/slapd/plugin.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
index 7dfab84..0b10678 100644
--- a/ldap/servers/slapd/plugin.c
+++ b/ldap/servers/slapd/plugin.c
@@ -1914,13 +1914,18 @@ void
plugin_dependency_freeall()
{
entry_and_plugin_t *iterp, *nextp;
+ char *value;
/* free the plugin dependency entry list */
iterp = dep_plugin_entries;
while (iterp) {
nextp = iterp->next;
+ if ((value = slapi_entry_attr_get_charptr(iterp->e, ATTR_PLUGIN_ENABLED)) &&
+ !strcasecmp(value, "off")) {
+ plugin_free(iterp->plugin);
+ }
+ slapi_ch_free_string(&value);
slapi_entry_free(iterp->e);
- /* plugin_free(iterp->plugin); */
slapi_ch_free((void **)&iterp);
iterp = nextp;
}
@@ -3031,7 +3036,7 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, slapi_p
add_plugin_entry_dn(dn_copy);
}
- if (add_entry && enabled) {
+ if (add_entry) {
/* make a copy of the plugin entry for our own use because it will
be freed later by the caller */
Slapi_Entry *e_copy = slapi_entry_dup(plugin_entry);
@@ -3040,7 +3045,7 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, slapi_p
}
PLUGIN_CLEANUP:
- if (status || !enabled) {
+ if (status) {
plugin_free(plugin);
}
slapi_ch_free((void **)&configdir);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.