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

memory leak in permissions module #533

Closed
eschmidbauer opened this issue Mar 7, 2016 · 4 comments
Closed

memory leak in permissions module #533

eschmidbauer opened this issue Mar 7, 2016 · 4 comments

Comments

@eschmidbauer
Copy link
Contributor

Hello,
We've noticed a memory leak caused by reloading the trusted table data.

kamctl trusted reload

We verified this by running script to reload the data frequently and captured memory usage using kex + corex.
Thanks,
Emmanuel

@miconda
Copy link
Member

miconda commented Mar 14, 2016

Can you attach the stats about memory usage? You had them on irc, it will help identifying the part of the code leaking. As discussed on irc, seems to be introduced by the new feature in 4.4 related to trusted table in permissions module.

@eschmidbauer
Copy link
Contributor Author

Hello,
I found the memory leak in permissions.
Can you please push this patch?

diff --git a/modules/permissions/hash.c b/modules/permissions/hash.c
index cfc81fe..84b20e2 100644
--- a/modules/permissions/hash.c
+++ b/modules/permissions/hash.c
@@ -423,6 +423,7 @@ void empty_hash_table(struct trusted_list **table)
                while (np) {
                        if (np->src_ip.s) shm_free(np->src_ip.s);
                        if (np->pattern) shm_free(np->pattern);
+                       if (np->ruri_pattern) shm_free(np->ruri_pattern);
                        if (np->tag.s) shm_free(np->tag.s);
                        next = np->next;
                        shm_free(np);

@miconda
Copy link
Member

miconda commented Mar 14, 2016

Make a pull request, then it can be easily merged. Don't forget to format the commit message as suggested by github commit guidelines from kamaikio.org wiki.

@eschmidbauer
Copy link
Contributor Author

Please see PR
#546

miconda added a commit that referenced this issue Mar 14, 2016
Fix memory leak by freeing RURI in trusted table struct; issue #533
@miconda miconda closed this as completed Mar 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants