-
Notifications
You must be signed in to change notification settings - Fork 115
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 pac_utils.h #96
Comments
Hello,
hence the
it should be enough doing instead
so there is no need to perform a |
Good catch, @fralken. My C-foo is pretty rusty now, but we don't really need to even create a copy of orig, right? We could simply use orig; it won't modify the underlying string |
Indeed you are right @manugarg since |
In file pac_utils.h line 339 str_replace.
char *tmporig = malloc(strlen(orig) + 1); // Copy of orig that we work with
The variable tmporig is allocated but never freed or returned, this cause a memory leak in pacparser_find_proxy (and probably some other APIs).
Adding free(tmporig) in the end of the function will solve this leak.
Thank you.
The text was updated successfully, but these errors were encountered: