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

Fix Memory Leak #1919

Merged
merged 2 commits into from
Feb 15, 2016
Merged

Fix Memory Leak #1919

merged 2 commits into from
Feb 15, 2016

Conversation

usta
Copy link
Contributor

@usta usta commented Feb 15, 2016

include_paths was leaking

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){
Copy link
Contributor

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());
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also spaces, not tabs.

@xzyfer
Copy link
Contributor

xzyfer commented Feb 15, 2016

Thanks @usta but please follow the existing code-style.

@usta
Copy link
Contributor Author

usta commented Feb 15, 2016

I hope this one is correct code-style

@xzyfer
Copy link
Contributor

xzyfer commented Feb 15, 2016

Much better, thank you.

@xzyfer xzyfer added this to the 3.3.4 milestone Feb 15, 2016
@usta
Copy link
Contributor Author

usta commented Feb 15, 2016

you are welcome

xzyfer added a commit that referenced this pull request Feb 15, 2016
@xzyfer xzyfer merged commit 676383a into sass:master Feb 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants