Skip to content

Memory leak when parsing throws an exception #56

@thorulf4

Description

@thorulf4

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions