From 6bc8e1c560a65f07f00b59039e06f733ec33c2af Mon Sep 17 00:00:00 2001 From: Chris Cole Date: Sat, 27 Sep 2014 23:34:10 -0400 Subject: [PATCH] Use CRYPTO_free to free the result of BN_bn2bin. --- src/bn/mod.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/bn/mod.rs b/src/bn/mod.rs index 7fa6c528b..3a6f18fd0 100644 --- a/src/bn/mod.rs +++ b/src/bn/mod.rs @@ -83,9 +83,7 @@ extern { /* Conversion from/to string representation */ fn BN_bn2dec(a: *mut BIGNUM) -> *const c_char; -/* - fn OpenSSL_free(buf: *const c_char); -*/ + fn CRYPTO_free(buf: *const c_char); } pub struct BigNum(*mut BIGNUM); @@ -441,9 +439,7 @@ impl BigNum { assert!(!buf.is_null()); let c_str = CString::new(buf, false); let str = c_str.as_str().unwrap().to_string(); -/* XXX - OpenSSL_free(buf); -*/ + CRYPTO_free(buf); str } } -- GitLab