OSSP CVS Repository

ossp - Ticket #210
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Attach]  [Edit]  [History

Ticket 210: Memory leak in Windows - CryptAcquireContext

In Windows builds there's a memory leak due to not releasing a CNG context after generating a pseudo random number.

¤https://github.com/sean-/ossp-uuid/blob/master/uuid_prng.c#L151

        if (CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0))
            CryptGenRandom(hProv, n, p);

The hProv variable should be released after calling CryptGenRandom:

            CryptReleaseContext(hProv, 0);
[Add remarks]

Remarks:

Properties:

Type: code           Version: 1.6.2 
Status: new          Created: 2026-Mar-13 11:45
Severity:          Last Change: 2026-Mar-13 11:45
Priority:          Subsystem: uuid 
Assigned To:            Derived From:  
Creator: anonymous 

CVSTrac 2.0.1