From: Jonas Maebe Date: Sun, 8 Dec 2013 21:46:44 +0000 (+0100) Subject: NETSCAPE_SPKI_b64_encode: free der_spki and b64_str on error path X-Git-Tag: master-post-reformat~489 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f6983d0d7618d6fb47c29c5e337eeeb40ba72b38;p=oweals%2Fopenssl.git NETSCAPE_SPKI_b64_encode: free der_spki and b64_str on error path Signed-off-by: Kurt Roeckx Reviewed-by: Dr. Stephen Henson --- 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;