-
Notifications
You must be signed in to change notification settings - Fork 464
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
Fix Memory Leak #1919
Fix Memory Leak #1919
Conversation
include_paths was leaking
@@ -220,7 +220,10 @@ extern "C" { | |||
size_t imp_size = 0; while (imp) { imp_size ++; imp = imp->next; } | |||
// create char* array to hold all paths plus null terminator | |||
const char** plugin_paths = (const char**) calloc(imp_size + 1, sizeof(char*)); | |||
if (plugin_paths == 0) throw(std::bad_alloc()); | |||
if (plugin_paths == 0){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the existing code-style and indentation.
if (plugin_paths == 0) {
free(include_paths); //free include_paths before throw
throw(std::bad_alloc());
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also spaces, not tabs.
Thanks @usta but please follow the existing code-style. |
I hope this one is correct code-style |
Much better, thank you. |
you are welcome |
include_paths was leaking