mirror of
https://github.com/openssl/openssl.git
synced 2025-03-31 20:10:45 +08:00
DTLS: free allocated memory on error paths
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/12870)
This commit is contained in:
parent
4f14a378f8
commit
48ff651ecc
@ -1051,12 +1051,16 @@ int dtls1_buffer_message(SSL *s, int is_ccs)
|
||||
if (!ossl_assert(s->d1->w_msg_hdr.msg_len +
|
||||
((s->version ==
|
||||
DTLS1_BAD_VER) ? 3 : DTLS1_CCS_HEADER_LENGTH)
|
||||
== (unsigned int)s->init_num))
|
||||
== (unsigned int)s->init_num)) {
|
||||
dtls1_hm_fragment_free(frag);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (!ossl_assert(s->d1->w_msg_hdr.msg_len +
|
||||
DTLS1_HM_HEADER_LENGTH == (unsigned int)s->init_num))
|
||||
DTLS1_HM_HEADER_LENGTH == (unsigned int)s->init_num)) {
|
||||
dtls1_hm_fragment_free(frag);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
frag->msg_header.msg_len = s->d1->w_msg_hdr.msg_len;
|
||||
|
Loading…
x
Reference in New Issue
Block a user