mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Avoid potential memory leak
Resolves #17827 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17828)
This commit is contained in:
parent
625b0990a0
commit
1753559230
@ -539,8 +539,11 @@ static int append_ia5(STACK_OF(OPENSSL_STRING) **sk,
|
||||
return 0;
|
||||
|
||||
emtmp = OPENSSL_strndup((char *)email->data, email->length);
|
||||
if (emtmp == NULL)
|
||||
if (emtmp == NULL) {
|
||||
X509_email_free(*sk);
|
||||
*sk = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Don't add duplicates */
|
||||
if (sk_OPENSSL_STRING_find(*sk, emtmp) != -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user