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 using exit() #2864

Open
itacud95 opened this issue Apr 29, 2024 · 0 comments
Open

Memory leak when using exit() #2864

itacud95 opened this issue Apr 29, 2024 · 0 comments

Comments

@itacud95
Copy link
Contributor

Describe the bug
I noticed valgrind reports a leak when using exit(0) in a test case.

Expected behavior
I would expect it not to leak.

Reproduction steps

TEST_CASE("fork") {
    pid_t pid = fork();
    REQUIRE(pid != -1);
    if (pid == 0) {
        exit(0);
    } else {
        int status;
        waitpid(pid, &status, 0);
    }
    CHECK(true);
}
// valgrind --leak-check=full ./binary

Platform information:

  • OS: linux
  • Compiler+version: g++ (GCC) 13.2.1 20230801
  • Catch version: v3.5.3

Additional context
valgrind version: 3.22

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

1 participant