Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,20 @@ internal static X509Certificate2[] X509ChainGetCertificates(SafeX509ChainContext
Debug.Assert(res <= certPtrs.Length);

var certs = new X509Certificate2[certPtrs.Length];
for (int i = 0; i < res; i++)
try
{
certs[i] = new X509Certificate2(certPtrs[i]);
for (int i = 0; i < res; i++)
{
// X509Certificate2 duplicates these JNI global refs; the native-returned refs remain caller-owned.
certs[i] = new X509Certificate2(certPtrs[i]);
Comment thread
simonrozsival marked this conversation as resolved.
}
}
finally
{
for (int i = 0; i < res; i++)
{
Interop.JObjectLifetime.DeleteGlobalReference(certPtrs[i]);
}
}
Comment thread
simonrozsival marked this conversation as resolved.

if (res == certPtrs.Length)
Expand Down
Loading