New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR - Issue 50955 - Fix memory leaks in chaining plugin #4009
Comments
Comment from firstyear (@Firstyear) at 2020-03-14 00:29:12 Most of it looks good, just curious about this cookie code here? Do you mind commenting to explain what it's doing? |
Comment from mreynolds (@mreynolds389) at 2020-03-14 00:31:23
That's how you traverse the backend list. Check other examples of slapi_get_first_backend() and they all use this "cookie". |
Comment from firstyear (@Firstyear) at 2020-03-14 00:39:49 Okay, I'll give this a more thorough read on Monday (I should be enjoying my weekend :) ) |
Comment from mreynolds (@mreynolds389) at 2020-03-14 00:44:38
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. |
Comment from firstyear (@Firstyear) at 2020-03-16 05:50:56 Okay, I've gone and had another review while looking at the source too, and I think this is good for me :) ack. |
Comment from mreynolds (@mreynolds389) at 2020-03-16 14:49:01 rebased onto d0c3763 |
Comment from mreynolds (@mreynolds389) at 2020-03-16 14:49:43 Pull-Request has been merged by mreynolds389 |
Patch |
Cloned from Pagure Pull-Request: https://pagure.io/389-ds-base/pull-request/50956
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: Resolves: #4008
The text was updated successfully, but these errors were encountered: