Browse Source

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 <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21981)
Bernd Edlinger 9 months ago
parent
commit
68e95f7840
1 changed files with 1 additions and 0 deletions
  1. 1 0
      crypto/srp/srp_vfy.c

+ 1 - 0
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;
     }