[CDRIVER-3228] Investigate whether allocated PCCERT_CONTEXT is freed Created: 10/Jul/19  Updated: 10/Feb/23

Status: Backlog
Project: C Driver
Component/s: libmongoc, tls
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-3227 PCCERT_CONTEXT may go out of scope in... Closed
Epic Link: CDRIVER-4575

 Description   

While looking into CDRIVER-3227 I realized that the PCCERT_CONTEXT pointer, which is initialized by CertSetCertificateContextProperty in mongoc_secure_channel_setup_certificate_from_file, is never freed.

Based on this program example in Microsoft's documentation, it looks like we should free the pointer with CertFreeCertificateContext.

I do see that the allocated PCCERT_CONTEXT is later passed to AcquireCredentialsHandle via the SCHANNEL_CRED struct, so perhaps it is ultimately freed later on. If so, there may be nothing to fix here.


Generated at Wed Feb 07 21:17:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.