projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
373a561
)
Fix memory leak on error.
author
Dr. Stephen Henson
<steve@openssl.org>
Thu, 8 Sep 2016 14:10:32 +0000
(15:10 +0100)
committer
Dr. Stephen Henson
<steve@openssl.org>
Sun, 11 Sep 2016 22:52:34 +0000
(23:52 +0100)
Backport leak fix from master branch.
Thanks to Shi Lei for reporting this bug.
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/x509/x509spki.c
patch
|
blob
|
history
diff --git
a/crypto/x509/x509spki.c
b/crypto/x509/x509spki.c
index 2df84ead9ef90e0cee7a894c928486cd34a19ba3..5ae5d30a35160a2e77146420dd0d25f46d303264 100644
(file)
--- a/
crypto/x509/x509spki.c
+++ b/
crypto/x509/x509spki.c
@@
-112,6
+112,8
@@
char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki)
der_spki = OPENSSL_malloc(der_len);
b64_str = OPENSSL_malloc(der_len * 2);
if (!der_spki || !b64_str) {
+ OPENSSL_free(der_spki);
+ OPENSSL_free(b64_str);
X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE);
return NULL;
}