Skip to content

Memory leak #10

@mingodad

Description

@mingodad

There is still one memory leak from C_user_main.cpp for the strdup in this line opts->output = strdup(optarg); bellow is a fix for it.

-------------------------- src/lrstar/PG_Generate.cpp --------------------------
index d72b551..a262076 100644
@@ -2561,6 +2561,7 @@ static void instantiate_main(FILE *fp, const char *grammar)
            "        delete [] input_start;\n"
            "    }\n\n"
            "    fclose(output_fp);\n"
+           "    free(options.output);\n"
            "    return 0;\n"
            "}\n"
            "\n");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions