diff options
author | Jonas Maebe <jonas.maebe@elis.ugent.be> | 2013-12-08 22:46:44 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2014-08-17 18:55:12 +0200 |
commit | f6983d0d7618d6fb47c29c5e337eeeb40ba72b38 (patch) | |
tree | 6b3431f399dfa227bf541a5233c1c161fc18920f | |
parent | 254f1c8019f4c2aa853208604f703deb8adfe131 (diff) |
NETSCAPE_SPKI_b64_encode: free der_spki and b64_str on error path
Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
-rw-r--r-- | crypto/x509/x509spki.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/x509/x509spki.c b/crypto/x509/x509spki.c index 02a203d72c..5addcc8cd8 100644 --- a/crypto/x509/x509spki.c +++ b/crypto/x509/x509spki.c @@ -111,6 +111,10 @@ char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki) b64_str = OPENSSL_malloc(der_len * 2); if(!der_spki || !b64_str) { X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE); + if (der_spki != NULL) + OPENSSL_free(der_spki); + if (b64_str != NULL) + OPENSSL_free(b64_str); return NULL; } p = der_spki; |