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 #10

Open
mingodad opened this issue Oct 7, 2024 · 1 comment
Open

Memory leak #10

mingodad opened this issue Oct 7, 2024 · 1 comment

Comments

@mingodad
Copy link

mingodad commented Oct 7, 2024

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");
@thutt
Copy link
Owner

thutt commented Oct 28, 2024

Can you provide information about how you tested this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants