Skip to content
Commit a3c1c955 authored by Geliang Tang's avatar Geliang Tang Committed by Alexei Starovoitov
Browse files

selftests/bpf: Free strdup memory in xdp_hw_metadata



The strdup() function returns a pointer to a new string which is a
duplicate of the string "ifname". Memory for the new string is obtained
with malloc(), and need to be freed with free().

This patch adds this missing "free(saved_hwtstamp_ifname)" in cleanup()
to avoid a potential memory leak in xdp_hw_metadata.c.

Signed-off-by: default avatarGeliang Tang <tanggeliang@kylinos.cn>
Link: https://lore.kernel.org/r/af9bcccb96655e82de5ce2b4510b88c9c8ed5ed0.1715417367.git.tanggeliang@kylinos.cn


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 5ddafcc3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment