aboutsummaryrefslogtreecommitdiff
path: root/src/wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrapper.c')
-rw-r--r--src/wrapper.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/wrapper.c b/src/wrapper.c
index 60dc9fd1..8f30aeba 100644
--- a/src/wrapper.c
+++ b/src/wrapper.c
@@ -120,14 +120,16 @@ void ssh_cipher_clear(struct ssh_cipher_struct *cipher){
SAFE_FREE(cipher->key);
}
#endif
- if (cipher->ctx != NULL) {
- if (cipher->cleanup != NULL) {
- cipher->cleanup(cipher);
- }
+
+ if (cipher->cleanup != NULL) {
+ cipher->cleanup(cipher);
+ }
+
#ifdef HAVE_LIBCRYPTO
+ if (cipher->ctx != NULL) {
EVP_CIPHER_CTX_free(cipher->ctx);
-#endif
}
+#endif
}
static void cipher_free(struct ssh_cipher_struct *cipher) {