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

fix(driver/bpf): close maps on cleanup #1959

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions userspace/libscap/engine/bpf/scap_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,15 @@ int32_t scap_bpf_close(struct scap_engine_handle engine)
handle->program_fd = -1;
}

for(int i = 0; i < BPF_MAPS_MAX; i++)
{
if(handle->m_bpf_map_fds[i] >= 0)
{
close(handle->m_bpf_map_fds[i]);
handle->m_bpf_map_fds[i] = -1;
}
}

return SCAP_SUCCESS;
}

Expand Down
Loading