]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix memory leak in tls_parse_ctos_psk()
authorNiels Dossche <7771979+nielsdos@users.noreply.github.com>
Wed, 9 Oct 2024 13:42:37 +0000 (15:42 +0200)
committerTomas Mraz <tomas@openssl.org>
Fri, 11 Oct 2024 12:54:39 +0000 (14:54 +0200)
commite11fa0559dbafd27e1e79501466abc7644c3a3a5
tree751068595e0b1662e74c3d84c873f9fe4b9fc411
parent698e36ad21d7892bd6be80256e0c3d5603d6d44e
Fix memory leak in tls_parse_ctos_psk()

`sess` is not NULL at this point, and is freed on the success path, but
not on the error path. Fix this by going to the `err` label such that
`SSL_SESSION_free(sess)` is called.

CLA: trivial

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25643)

(cherry picked from commit b2474b287fbc7a24f0aa15e6808c6e3ef8287f23)
ssl/statem/extensions_srvr.c