aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Wilder <wilder.michael@cimcor.com>2015-08-21 13:45:18 -0500
committerAndreas Schneider <asn@cryptomilk.org>2015-09-07 07:45:02 +0200
commit2f193b5cbb0c57160d3c590140bc04befccfbb32 (patch)
treedd6ae3e99b7451cfb7fce52efdd5fb989a4f74c7
parente6f93c887ba5e62d6c5b5f87ec1910fb25f6bbad (diff)
downloadlibssh-2f193b5cbb0c57160d3c590140bc04befccfbb32.tar.gz
libssh-2f193b5cbb0c57160d3c590140bc04befccfbb32.tar.xz
libssh-2f193b5cbb0c57160d3c590140bc04befccfbb32.zip
bignum: Fix OpenSSL crash in SAFE_FREE
Signed-off-by: Michael Wilder <wilder.michael@cimcor.com> Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r--src/bignum.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bignum.c b/src/bignum.c
index 36bd140d..e9c16dd1 100644
--- a/src/bignum.c
+++ b/src/bignum.c
@@ -103,5 +103,9 @@ void ssh_print_bignum(const char *which, bignum num) {
#endif
fprintf(stderr, "%s value: ", which);
fprintf(stderr, "%s\n", (hex == NULL) ? "(null)" : (char *) hex);
+#ifdef HAVE_LIBGCRYPT
SAFE_FREE(hex);
+#elif defined HAVE_LIBCRYPTO
+ OPENSSL_free(hex);
+#endif
}