This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 8b9783b7f5667b3a37f039222e06448af2eec070 (commit) from 036f1d33b5d186a68748a5465713370b1c602545 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 8b9783b7f5667b3a37f039222e06448af2eec070 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Wed May 10 02:47:11 2017 +0300
linux-generic: crypto: don't leak sessions if creation fails
We should free allocated session in odp_crypto_session_create() error paths, so that the session is not leaked.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index b432f84a..c5473d95 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -678,6 +678,7 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, if (session->p.iv.data) { if (session->p.iv.length > MAX_IV_LEN) { ODP_DBG("Maximum IV length exceeded\n"); + free_session(session); return -1; }
@@ -724,6 +725,7 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, /* Check result */ if (rc) { *status = ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER; + free_session(session); return -1; }
@@ -763,6 +765,7 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, /* Check result */ if (rc) { *status = ODP_CRYPTO_SES_CREATE_ERR_INV_AUTH; + free_session(session); return -1; }
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/odp_crypto.c | 3 +++ 1 file changed, 3 insertions(+)
hooks/post-receive