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 when parsing throws an exception #56

Open
thorulf4 opened this issue Jul 6, 2023 · 0 comments
Open

Memory leak when parsing throws an exception #56

thorulf4 opened this issue Jul 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@thorulf4
Copy link
Contributor

thorulf4 commented Jul 6, 2023

If an exception is thrown during parsing any memory allocated by the lexer is not deallocated. It's a pretty minor issue as leaked memory is minimal and it only occurs on bad execution paths.

See code parser.cpp:9293

int32_t parseProperty(const char *str, ParserBuilder *aParserBuilder, const std::string& xpath)
{
    utap__scan_string(str); <--- If thrown here
    int32_t res = parseProperty(aParserBuilder, xpath);
    utap__delete_buffer(YY_CURRENT_BUFFER); <--- cleanup wont be called
    return res;
}
@thorulf4 thorulf4 added the bug Something isn't working label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant