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);
Remarks:
Properties:
| Type: |
code |
|
Version: |
1.6.2 |
| Status: |
new |
|
Created: |
2026-Mar-13 11:45 |
| Severity: |
3 |
|
Last Change: |
2026-Mar-13 11:45 |
| Priority: |
3 |
|
Subsystem: |
uuid |
| Assigned To: |
|
|
Derived From: |
|
| Creator: |
anonymous |