From: Bernd Edlinger Date: Wed, 6 Sep 2023 12:06:52 +0000 (+0200) Subject: Fix a possible memleak in SRP_VBASE_new X-Git-Tag: openssl-3.2.0-alpha2~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68e95f7840d0d8ac4e5e03381cf9d305578dd1c7;p=thirdparty%2Fopenssl.git Fix a possible memleak in SRP_VBASE_new In the error handling case the memory in vb->users_pwd was accidentally not released. Reviewed-by: Paul Dale Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/21981) --- diff --git a/crypto/srp/srp_vfy.c b/crypto/srp/srp_vfy.c index 72ef5e814e6..2ca515396b7 100644 --- a/crypto/srp/srp_vfy.c +++ b/crypto/srp/srp_vfy.c @@ -281,6 +281,7 @@ SRP_VBASE *SRP_VBASE_new(char *seed_key) return NULL; if ((vb->users_pwd = sk_SRP_user_pwd_new_null()) == NULL || (vb->gN_cache = sk_SRP_gN_cache_new_null()) == NULL) { + sk_SRP_user_pwd_free(vb->users_pwd); OPENSSL_free(vb); return NULL; }