mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Fix memory leaks in the Certificate extensions code
After collecting extensions we must free them again. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2284)
This commit is contained in:
parent
0fe2a0af89
commit
5ee289eaf6
@ -1425,8 +1425,11 @@ MSG_PROCESS_RETURN tls_process_server_certificate(SSL *s, PACKET *pkt)
|
||||
if (!tls_collect_extensions(s, &extensions, EXT_TLS1_3_CERTIFICATE,
|
||||
&rawexts, &al)
|
||||
|| !tls_parse_all_extensions(s, EXT_TLS1_3_CERTIFICATE,
|
||||
rawexts, x, chainidx, &al))
|
||||
rawexts, x, chainidx, &al)) {
|
||||
OPENSSL_free(rawexts);
|
||||
goto f_err;
|
||||
}
|
||||
OPENSSL_free(rawexts);
|
||||
}
|
||||
|
||||
if (!sk_X509_push(sk, x)) {
|
||||
|
@ -3061,8 +3061,11 @@ MSG_PROCESS_RETURN tls_process_client_certificate(SSL *s, PACKET *pkt)
|
||||
if (!tls_collect_extensions(s, &extensions, EXT_TLS1_3_CERTIFICATE,
|
||||
&rawexts, &al)
|
||||
|| !tls_parse_all_extensions(s, EXT_TLS1_3_CERTIFICATE,
|
||||
rawexts, x, chainidx, &al))
|
||||
rawexts, x, chainidx, &al)) {
|
||||
OPENSSL_free(rawexts);
|
||||
goto f_err;
|
||||
}
|
||||
OPENSSL_free(rawexts);
|
||||
}
|
||||
|
||||
if (!sk_X509_push(sk, x)) {
|
||||
|
Loading…
Reference in New Issue
Block a user