From a55119ccfe3df2c7321a8a1940c62d21ea06ac2c Mon Sep 17 00:00:00 2001 From: makejian Date: Fri, 20 Dec 2024 15:42:06 +0800 Subject: [PATCH] crypto/cryptodev: fix memory leak when failed to open /dev/crypto Free the allocated fcrypt structure when opening /dev/crypto device fails, preventing memory leak. Signed-off-by: makejian --- crypto/cryptodev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/cryptodev.c b/crypto/cryptodev.c index 37db28d590f..bd9cfe93673 100644 --- a/crypto/cryptodev.c +++ b/crypto/cryptodev.c @@ -982,6 +982,7 @@ bail: kmm_free(cria.cri_key); } + free(fcrd); return ret; }