提交 6cb9fca7 编写于 作者: D Dr. Stephen Henson

Fix memory leak. The canonical X509_NAME_ENTRY STACK is reallocated rather

than referencing existing X509_NAME_ENTRY structures so needs to be
completely freed.
上级 ec0bfca7
......@@ -244,6 +244,11 @@ static void local_sk_X509_NAME_ENTRY_free(STACK_OF(X509_NAME_ENTRY) *ne)
sk_X509_NAME_ENTRY_free(ne);
}
static void local_sk_X509_NAME_ENTRY_pop_free(STACK_OF(X509_NAME_ENTRY) *ne)
{
sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
}
static int x509_name_encode(X509_NAME *a)
{
union { STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
......@@ -372,7 +377,7 @@ static int x509_name_canon(X509_NAME *a)
X509_NAME_ENTRY_free(tmpentry);
if (intname)
sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
local_sk_X509_NAME_ENTRY_free);
local_sk_X509_NAME_ENTRY_pop_free);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册