[LTP] [PATCH] tst_af_alg: Fix control buffer memory leak

Andrea Cervesato andrea.cervesato@suse.de
Fri Sep 11 09:53:40 CEST 2026


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>



More information about the ltp mailing list