Skip to content

Fix segfault when Nic::open() fails#98

Open
Hojun-Cho wants to merge 3 commits intotsnlab:masterfrom
Hojun-Cho:fix/nic-drop-and-memory-leak
Open

Fix segfault when Nic::open() fails#98
Hojun-Cho wants to merge 3 commits intotsnlab:masterfrom
Hojun-Cho:fix/nic-drop-and-memory-leak

Conversation

@Hojun-Cho
Copy link
Copy Markdown

  • Fix FIXME: segfault when Nic::open() fails

    Cause: xsk was heap-allocated zeroed memory, not NULL. Drop called xsk_socket__delete() on it.

    Fix: use null_mut() instead of heap allocation. cleanup xsk in error path, set to NULL. Skip Drop if NULL.

    xsk_socket__delete
    xsk_socket__create_shared

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

Successfully merging this pull request may close these issues.

1 participant