diff mbox

[PATCHv2] linux-generic:release memory during session destory

Message ID 1458044133-14433-1-git-send-email-balakrishna.garapati@linaro.org
State Superseded
Headers show

Commit Message

Balakrishna Garapati March 15, 2016, 12:15 p.m. UTC
v2:Added the whitespace after if
Signed-off-by: balakrishna.garapati <balakrishna.garapati@linaro.org>
---
 platform/linux-generic/odp_crypto.c | 2 ++
 1 file changed, 2 insertions(+)

--
1.9.1
diff mbox

Patch

diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c
index 08b479d..e468677 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -704,6 +704,8 @@  int odp_crypto_session_destroy(odp_crypto_session_t session)
 	odp_crypto_generic_session_t *generic;

 	generic = (odp_crypto_generic_session_t *)(intptr_t)session;
+        if (generic->cipher.alg == ODP_CIPHER_ALG_AES128_GCM)
+        	EVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx);
 	memset(generic, 0, sizeof(*generic));
 	free_session(generic);
 	return 0;