#50401 Ticket 50340 - 2nd try - structs for diabled plugins will not be freed
Closed 3 years ago by spichugi. Opened 4 years ago by lkrispen.
lkrispen/389-ds-base t50340-2  into  master

file modified
+8 -3
@@ -1914,13 +1914,18 @@ 

  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 @@ 

          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_CLEANUP:

-     if (status || !enabled) {

+     if (status) {

          plugin_free(plugin);

      }

      slapi_ch_free((void **)&configdir);

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:  ?

THis passes my tests and it seems to resolve the initial regression. Merging for Ludwig...

Pull-Request has been closed by mreynolds

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3459

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata