Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak
@ 2026-09-11  7:53 Andrea Cervesato
  2026-09-11  8:42 ` [LTP] " linuxtestproject.agent
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrea Cervesato @ 2026-09-11  7:53 UTC (permalink / raw)
  To: Linux Test Project

From: Andrea Cervesato <andrea.cervesato@suse.com>

The ancillary control buffer allocated in tst_alg_sendmsg() is never
freed after sendmsg(), leaking memory on repeated calls in the same
process.

Free the buffer once sendmsg() completes.

Fixes: 3cbb963abb9e ("lib/tst_af_alg: add tst_alg_sendmsg()")
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 lib/tst_af_alg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/tst_af_alg.c b/lib/tst_af_alg.c
index 93757278f..10fb42da5 100644
--- a/lib/tst_af_alg.c
+++ b/lib/tst_af_alg.c
@@ -249,4 +249,6 @@ void tst_alg_sendmsg(int reqfd, const void *data, size_t datalen,
 	}
 
 	SAFE_SENDMSG(datalen, reqfd, &msg, params->msg_flags);
+
+	free(control);
 }

---
base-commit: b8f93f82fd94a598d632ee3785cf664efd97afae
change-id: 20260911-fix_core_leak_astra-e268a19d4658

Best regards,
--  
Andrea Cervesato <andrea.cervesato@suse.com>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2026-09-11 10:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11  7:53 [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak Andrea Cervesato
2026-09-11  8:42 ` [LTP] " linuxtestproject.agent
2026-09-11  9:43 ` [LTP] [PATCH] " Petr Vorel
2026-09-11 10:09 ` Andrea Cervesato via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox