diff options
| author | Cody P Schafer <[email protected]> | 2014-10-13 15:14:58 -0400 |
|---|---|---|
| committer | Cody P Schafer <[email protected]> | 2014-11-24 15:38:04 -0500 |
| commit | 381a9b6e511099b71891ebcec48b131cf80f2c51 (patch) | |
| tree | dc9d16222f2f999b7a2c9e10c3e2262cd4a3ab27 /src | |
| parent | Add more crate metadata (diff) | |
| download | rust-openssl-381a9b6e511099b71891ebcec48b131cf80f2c51.tar.xz rust-openssl-381a9b6e511099b71891ebcec48b131cf80f2c51.zip | |
sys (and bn): make CRYPTO_free() take a *mut c_void insead of a *const c_char
CRYPTO_free() ends up being used for a variety of types of data, not just
c_char. And it essentially takes full ownership of the type, making
*mut appropriate.
With this change it also more closely (exactly) matches the C defintion:
void CRYPTO_free(void *ptr);
Diffstat (limited to 'src')
| -rw-r--r-- | src/bn/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bn/mod.rs b/src/bn/mod.rs index b33f94ce..2536f8a5 100644 --- a/src/bn/mod.rs +++ b/src/bn/mod.rs @@ -1,4 +1,4 @@ -use libc::{c_int, c_ulong}; +use libc::{c_int, c_ulong, c_void}; use std::{fmt, ptr}; use std::c_str::CString; @@ -348,7 +348,7 @@ impl BigNum { assert!(!buf.is_null()); let c_str = CString::new(buf, false); let str = c_str.as_str().unwrap().to_string(); - ffi::CRYPTO_free(buf); + ffi::CRYPTO_free(buf as *mut c_void); str } } |