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
This commit is contained in:
Wonki Kim 2020-03-17 04:51:02 +00:00 committed by Marcel Hollerbach
parent 13d52be7e6
commit 3cf0bdd599
1 changed files with 6 additions and 0 deletions

View File

@ -193,8 +193,14 @@ on_error:
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
if (ctx)
EVP_CIPHER_CTX_cleanup(ctx);
#else
if (ctx) {
EVP_CIPHER_CTX_cleanup(ctx);
EVP_CIPHER_CTX_free(ctx);
}
#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */
free(buffer);
/* General error */