提交 2b61034b 编写于 作者: B Bodo Möller

fix potential memory leak when allocation fails

PR: 801
Submitted by: Nils Larsch
上级 80c808b9
......@@ -627,6 +627,9 @@ int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,
dataB=BUF_MEM_new();
if ((nameB == NULL) || (headerB == NULL) || (dataB == NULL))
{
BUF_MEM_free(nameB);
BUF_MEM_free(headerB);
BUF_MEM_free(dataB);
PEMerr(PEM_F_PEM_READ_BIO,ERR_R_MALLOC_FAILURE);
return(0);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册