-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Milestone
Description
In results of static analyze of aspnetcore sources with Svace static analyzer I was found error of cathegory HANDLE_LEAK with message
new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet) is not disposed at the end of the function
This error was found in internal method ImportCertificate
certificate = new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet); |
I see, that there working with created certificate takes specific paths that include platform point, and in variable certificate
it can be stored new certificate object.
SaveCertificate(certificate); |
But at all, how about to add correct disposing of object?
Maybe call of SaveCertificate
method should be like:
using var _ = SaveCertifiicate(certificate);
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Copilot
Metadata
Metadata
Assignees
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions