projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
625b099
)
Avoid potential memory leak
author
Dmitry Belyavskiy
<beldmit@gmail.com>
Mon, 7 Mar 2022 16:05:57 +0000
(17:05 +0100)
committer
Matt Caswell
<matt@openssl.org>
Thu, 10 Mar 2022 14:10:53 +0000
(14:10 +0000)
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)
crypto/x509/v3_utl.c
patch
|
blob
|
history
diff --git
a/crypto/x509/v3_utl.c
b/crypto/x509/v3_utl.c
index ae53554e58c3c3720a10f115a63a3f84df524373..688c2ee722aadf6b48bd68d7cd5702a0c3407832 100644
(file)
--- a/
crypto/x509/v3_utl.c
+++ b/
crypto/x509/v3_utl.c
@@
-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) {