summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorWonki Kim <wonki_.kim@samsung.com>2020-03-17 04:51:02 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-04-06 09:05:08 +0200
commit3cf0bdd599d741d94acc459078c8f198aa218ca9 (patch)
treea3f1aef5127bc51cc03daec5b6ce674dbae4a114 /src/lib/emile
parent13d52be7e6a2a7f761996bb850b10127378b190f (diff)
emile: fix a potentional resource leaking.
'ctx' can be leaked in some case. this pathc fixes it. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11368
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_cipher_openssl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/emile/emile_cipher_openssl.c b/src/lib/emile/emile_cipher_openssl.c
index e8ec3af93b..b09897ec9b 100644
--- a/src/lib/emile/emile_cipher_openssl.c
+++ b/src/lib/emile/emile_cipher_openssl.c
@@ -193,8 +193,14 @@ on_error:
193#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) 193#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
194 if (ctx) 194 if (ctx)
195 EVP_CIPHER_CTX_cleanup(ctx); 195 EVP_CIPHER_CTX_cleanup(ctx);
196#else
197 if (ctx) {
198 EVP_CIPHER_CTX_cleanup(ctx);
199 EVP_CIPHER_CTX_free(ctx);
200 }
196#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */ 201#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */
197 202
203
198 free(buffer); 204 free(buffer);
199 205
200 /* General error */ 206 /* General error */