From afa6fc7a7c7f3e11a2989b2f6912e59ed8e8a354 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Wed, 17 Oct 2018 07:26:46 +0000 Subject: [PATCH] Fix ctx initialization Signed-off-by: Janos SUTO --- src/archive.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/archive.c b/src/archive.c index 7f68e720..e85dbb05 100644 --- a/src/archive.c +++ b/src/archive.c @@ -138,7 +138,7 @@ int retrieve_file_from_archive(char *filename, int mode, char **buffer, FILE *de #if OPENSSL_VERSION_NUMBER < 0x10100000L EVP_CIPHER_CTX ctx; #else - EVP_CIPHER_CTX *ctx; + EVP_CIPHER_CTX *ctx=NULL; #endif @@ -227,7 +227,7 @@ CLEANUP: #if OPENSSL_VERSION_NUMBER < 0x10100000L EVP_CIPHER_CTX_cleanup(&ctx); #else - EVP_CIPHER_CTX_free(ctx); + if(ctx) EVP_CIPHER_CTX_free(ctx); #endif return 0;