提交 764ca96c 编写于 作者: D Dr. Stephen Henson

Fix memory leak.

Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 351fe214
......@@ -75,7 +75,7 @@ unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
int passlen, unsigned char *in, int inlen,
unsigned char **data, int *datalen, int en_de)
{
unsigned char *out;
unsigned char *out = NULL;
int outlen, i;
EVP_CIPHER_CTX ctx;
......@@ -85,7 +85,7 @@ unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
algor->parameter, &ctx, en_de)) {
PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,
PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR);
return NULL;
goto err;
}
if ((out = OPENSSL_malloc(inlen + EVP_CIPHER_CTX_block_size(&ctx)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册