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.1.3~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d39402f7b909c9b5cc7eef7a633e14dccc90807d;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) (cherry picked from commit 68e95f7840d0d8ac4e5e03381cf9d305578dd1c7) --- diff --git a/crypto/srp/srp_vfy.c b/crypto/srp/srp_vfy.c index e8beb60d278..edcfb0c76e5 100644 --- a/crypto/srp/srp_vfy.c +++ b/crypto/srp/srp_vfy.c @@ -283,6 +283,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; }