Skip to content

Commit

Permalink
xdp_sock: Fix memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: Iliya Iliev <iliyailiev3592@gmail.com>
  • Loading branch information
IlievIliya92 committed May 1, 2023
1 parent 94b0319 commit 69d4864
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xdp_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ xdp_sock_destroy (xdp_sock_t **self_p)
if (*self_p) {
xdp_sock_t *self = *self_p;
// Free class properties here
struct xsk_umem *umem = self->umem->umem;
xsk_socket__delete(self->xsk);
(void)xsk_umem__delete(umem);
(void)xsk_umem__delete(self->umem->umem);
free(self->umem);

munmap(self->bufs, XDP_IFACE_XSK_FRAMES * XDP_IFACE_XSK_FRAMESIZE);
// Free object itself
Expand Down

0 comments on commit 69d4864

Please sign in to comment.