Skip to content
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

Closed
389-ds-bot opened this issue Sep 13, 2020 · 8 comments
Closed

PR - Issue 50955 - Fix memory leaks in chaining plugin #4009

389-ds-bot opened this issue Sep 13, 2020 · 8 comments
Labels
merged Migration flag - PR pr Migration flag - PR

Comments

@389-ds-bot
Copy link

389-ds-bot commented Sep 13, 2020

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

@389-ds-bot 389-ds-bot added merged Migration flag - PR pr Migration flag - PR labels Sep 13, 2020
@389-ds-bot
Copy link
Author

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?

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2020-03-14 00:31:23

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".

@389-ds-bot
Copy link
Author

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

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2020-03-14 00:44:38

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.

@389-ds-bot
Copy link
Author

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.

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2020-03-16 14:49:01

rebased onto d0c3763

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2020-03-16 14:49:43

Pull-Request has been merged by mreynolds389

@389-ds-bot
Copy link
Author

Patch
50956.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged Migration flag - PR pr Migration flag - PR
Projects
None yet
Development

No branches or pull requests

1 participant