Commit 106d6138 authored by Thomas Whiteway's avatar Thomas Whiteway
Browse files

Free r and s on ECDSA_SIG before overwriting them in ECDSA_SIG_set0

parent dbe0672d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -138,6 +138,11 @@ cfg_if! {
            r: *mut ffi::BIGNUM,
            s: *mut ffi::BIGNUM,
        ) -> c_int {
            if r.is_null() || s.is_null() {
                return 0;
            }
            ffi::BN_clear_free((*sig).r);
            ffi::BN_clear_free((*sig).s);
            (*sig).r = r;
            (*sig).s = s;
            1