Unverified Commit a644ec25 authored by Alex Gaynor's avatar Alex Gaynor Committed by GitHub
Browse files

Merge pull request #2170 from botovq/crypto-free

LibreSSL 3.9: fix CRYPTO_malloc/free signatures
parents 51fc5694 83940d14
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ pub type CRYPTO_EX_free = unsafe extern "C" fn(
    argp: *mut c_void,
);

#[cfg(ossl110)]
#[cfg(any(ossl110, libressl390))]
#[inline]
#[track_caller]
pub unsafe fn OPENSSL_malloc(num: usize) -> *mut c_void {
@@ -68,7 +68,7 @@ pub unsafe fn OPENSSL_malloc(num: usize) -> *mut c_void {
    )
}

#[cfg(not(ossl110))]
#[cfg(not(any(ossl110, libressl390)))]
#[inline]
#[track_caller]
pub unsafe fn OPENSSL_malloc(num: c_int) -> *mut c_void {
@@ -79,7 +79,7 @@ pub unsafe fn OPENSSL_malloc(num: c_int) -> *mut c_void {
    )
}

#[cfg(ossl110)]
#[cfg(any(ossl110, libressl390))]
#[inline]
#[track_caller]
pub unsafe fn OPENSSL_free(addr: *mut c_void) {
@@ -90,7 +90,7 @@ pub unsafe fn OPENSSL_free(addr: *mut c_void) {
    )
}

#[cfg(not(ossl110))]
#[cfg(not(any(ossl110, libressl390)))]
#[inline]
pub unsafe fn OPENSSL_free(addr: *mut c_void) {
    CRYPTO_free(addr)
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ extern "C" {
}

cfg_if! {
    if #[cfg(ossl110)] {
    if #[cfg(any(ossl110, libressl390))] {
        extern "C" {
            pub fn CRYPTO_malloc(num: size_t, file: *const c_char, line: c_int) -> *mut c_void;
            pub fn CRYPTO_free(buf: *mut c_void, file: *const c_char, line: c_int);