mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
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>
This commit is contained in:
parent
254f1c8019
commit
f6983d0d76
@ -111,6 +111,10 @@ char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki)
|
|||||||
b64_str = OPENSSL_malloc(der_len * 2);
|
b64_str = OPENSSL_malloc(der_len * 2);
|
||||||
if(!der_spki || !b64_str) {
|
if(!der_spki || !b64_str) {
|
||||||
X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE);
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
p = der_spki;
|
p = der_spki;
|
||||||
|
Loading…
Reference in New Issue
Block a user