未验证 提交 07fce444 编写于 作者: M Marius Ungureanu 提交者: GitHub

Fix leaks caused by mismatch of CFRelease/CFRetain with SecItemCopyMatching

上级 f0845bde
......@@ -45,12 +45,10 @@ static int32_t EnumerateKeychain(CFStringRef matchType, CFArrayRef* pCertsOut)
assert(result == NULL);
status = noErr;
}
else
if (result != NULL)
{
if (result != NULL)
{
CFRelease(result);
}
CFRelease(result);
}
return status;
......
......@@ -262,6 +262,11 @@ static bool IsCertInKeychain(CFTypeRef needle, SecKeychainRef haystack)
{
ret = false;
}
if (result != NULL)
{
CFRelease(result);
}
CFRelease(itemMatch);
CFRelease(searchList);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册