bignum: Fix OpenSSL crash in SAFE_FREE

Signed-off-by: Michael Wilder <wilder.michael@cimcor.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Michael Wilder
2015-08-21 13:45:18 -05:00
committed by Andreas Schneider
parent e6f93c887b
commit 2f193b5cbb

View File

@@ -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
}