netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: net: fix memory leak in tls.c
@ 2025-08-19  2:45 Cryolitia PukNgae via B4 Relay
  2025-08-21 18:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Cryolitia PukNgae via B4 Relay @ 2025-08-19  2:45 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Shuah Khan
  Cc: netdev, linux-kselftest, linux-kernel, zhanjun, niecheng1,
	guanwentao, Cryolitia PukNgae

From: Cryolitia PukNgae <cryolitia@uniontech.com>

To free memory and close fd after use

Suggested-by: Jun Zhan <zhanjun@uniontech.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
---
 tools/testing/selftests/net/tls.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index d8cfcf9bb82594ca078c998ce5849131bf46ade8..23cf6ff5fa49378bd7906334ff402aa61a205f29 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -427,6 +427,8 @@ TEST_F(tls, sendfile)
 	EXPECT_GE(filefd, 0);
 	fstat(filefd, &st);
 	EXPECT_GE(sendfile(self->fd, filefd, 0, st.st_size), 0);
+
+	close(filefd);
 }
 
 TEST_F(tls, send_then_sendfile)
@@ -448,6 +450,9 @@ TEST_F(tls, send_then_sendfile)
 
 	EXPECT_GE(sendfile(self->fd, filefd, 0, st.st_size), 0);
 	EXPECT_EQ(recv(self->cfd, buf, st.st_size, MSG_WAITALL), st.st_size);
+
+	free(buf);
+	close(filefd);
 }
 
 static void chunked_sendfile(struct __test_metadata *_metadata,

---
base-commit: be48bcf004f9d0c9207ff21d0edb3b42f253829e
change-id: 20250819-memoryleak-9dbec9af6c07

Best regards,
-- 
Cryolitia PukNgae <cryolitia@uniontech.com>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: net: fix memory leak in tls.c
  2025-08-19  2:45 [PATCH] selftests: net: fix memory leak in tls.c Cryolitia PukNgae via B4 Relay
@ 2025-08-21 18:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-21 18:20 UTC (permalink / raw)
  To: Cryolitia PukNgae
  Cc: davem, edumazet, kuba, pabeni, horms, shuah, netdev,
	linux-kselftest, linux-kernel, zhanjun, niecheng1, guanwentao

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 19 Aug 2025 10:45:57 +0800 you wrote:
> From: Cryolitia PukNgae <cryolitia@uniontech.com>
> 
> To free memory and close fd after use
> 
> Suggested-by: Jun Zhan <zhanjun@uniontech.com>
> Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
> 
> [...]

Here is the summary with links:
  - selftests: net: fix memory leak in tls.c
    https://git.kernel.org/netdev/net-next/c/e5b71dd3ad0e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-21 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19  2:45 [PATCH] selftests: net: fix memory leak in tls.c Cryolitia PukNgae via B4 Relay
2025-08-21 18:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).