提交 f6983d0d 编写于 作者: J Jonas Maebe 提交者: Kurt Roeckx

NETSCAPE_SPKI_b64_encode: free der_spki and b64_str on error path

Signed-off-by: NKurt Roeckx <kurt@openssl.org>
Reviewed-by: NDr. Stephen Henson <steve@openssl.org>
上级 254f1c80
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册