Memory leak when using exit()
Open
- Dominant language
- C++
- Stars
- 21.5k
- Forks
- 3.5k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 2
Description
**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
Contributor guide
Assessment
This issue has not been assessed yet.