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-08 17:32:40 +0200
commit25234e510ad26505e48d1b04e4535e96fc55967a (patch)
treeae1bad31b3632143d117e31f4286e931c65d1766
parentd16eac5704d211d0440710d3623f135622ad2007 (diff)
downloadlibssh-25234e510ad26505e48d1b04e4535e96fc55967a.tar.gz
libssh-25234e510ad26505e48d1b04e4535e96fc55967a.tar.xz
libssh-25234e510ad26505e48d1b04e4535e96fc55967a.zip
bignum: Fix OpenSSL crash in SAFE_FREE
Signed-off-by: Michael Wilder <wilder.michael@cimcor.com> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 2f193b5cbb0c57160d3c590140bc04befccfbb32)
-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
}