#50956 Issue 50955 - Fix memory leaks in chaining plugin
Closed by spichugi. Opened by mreynolds.
mreynolds/389-ds-base issue50955  into  master

Download 50956.patch

Bug Description:

There are many leaks caused by reinitializing a chaining backend, and there are other leaks caused with initialization allocations are not freed in the plugin's close() function.

Fix Description:

Make sure we free pointers before blindly overwriting them, and make sure we call chaining instance free function for all chaining backends when stopping the plugin.

relates: https://pagure.io/389-ds-base/issue/50955

Most of it looks good, just curious about this cookie code here? Do you mind commenting to explain what it's doing?

Most of it looks good, just curious about this cookie code here? Do you mind commenting to explain what it's doing?

That's how you traverse the backend list. Check other examples of slapi_get_first_backend() and they all use this "cookie".

Okay, I'll give this a more thorough read on Monday (I should be enjoying my weekend :) )

Okay, I'll give this a more thorough read on Monday (I should be enjoying my weekend :) )

Sure, and in case I missed your question/concern, what that code is doing is looping over all the backends trying to find any chaining backends. If it is a chaining backend then we call the chaining instance free function.

The code that uses a "cookie" is just how those functions are designed to walk all the backends.

Okay, I've gone and had another review while looking at the source too, and I think this is good for me :) ack.

rebased onto d0c37639a585ab3ba6f7b16f4d4bf2501fbcb0bd

Pull-Request has been merged by mreynolds

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/4009

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

Metadata