Skip to content

Commit

Permalink
fix(libsinsp_e2e): use _exit(0)
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
  • Loading branch information
therealbobo committed Mar 6, 2024
1 parent 0f32f18 commit 134c34f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/libsinsp_e2e/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ TEST_F(sys_call_test, container_cgroups)
if (ctid == 0)
{
sleep(1);
exit(0);
// _exit prevents asan from complaining for a false positive memory leak.
_exit(0);
}
else
{
Expand Down Expand Up @@ -286,11 +287,8 @@ static void run_container_docker_test(bool fork_after_container_start)
ASSERT_TRUE(child_pid >= 0) << "Could not fork" << strerror(errno);
if (child_pid == 0)
{
// Note: intentionally not doing _exit to
// ensure container resolvers don't rely on
// globals. Of course, it depends on all other
// globals being able to be deleted twice.
exit(0);
// _exit prevents asan from complaining for a false positive memory leak.
_exit(0);
}
else
{
Expand Down

0 comments on commit 134c34f

Please sign in to comment.