]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/net: bind_bhash: fix memory leak in bind_socket
authorlonglong yan <yanlonglong@kylinos.cn>
Mon, 1 Jun 2026 01:39:27 +0000 (09:39 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 3 Jun 2026 02:27:25 +0000 (19:27 -0700)
commitdfcc2ff12925d99e858eaf539eaa4aaaf81fe2a6
tree6ebc29b91c7183947f75e636fd96bc6c43383ea2
parentedceeba4af3df39ec7e446e86ead50bbbbc85849
selftests/net: bind_bhash: fix memory leak in bind_socket

The getaddrinfo() call in bind_socket() dynamically allocates memory
for the result linked list that must be freed with freeaddrinfo().
However, none of the code paths after a successful getaddrinfo() call
free this memory, causing a leak in every invocation of bind_socket().

Signed-off-by: longlong yan <yanlonglong@kylinos.cn>
Link: https://patch.msgid.link/20260601013927.1835-1-yanlonglong@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/bind_bhash.c