santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cullum, Steve" <steven.cul...@eds.com>
Subject [C++] more memory leaks in windows WinCAPICryptoXXXX files
Date Mon, 17 Oct 2005 12:05:27 GMT
Some more potential memory leaks in the following files .. I have not
tested all of them 

\xml-security\c\src\enc\WinCAPI\WinCAPICryptoHashHMAC.cpp(211):
HCRYPTHASH h;
\xml-security\c\src\enc\WinCAPI\WinCAPICryptoHashHMAC.cpp(339):
HCRYPTHASH h;
\xml-security\c\src\enc\WinCAPI\WinCAPICryptoKeyDSA.cpp(348):
HCRYPTHASH h;
\xml-security\c\src\enc\WinCAPI\WinCAPICryptoKeyDSA.cpp(422):
HCRYPTHASH h;
\xml-security\c\src\enc\WinCAPI\WinCAPICryptoKeyRSA.cpp(300):
HCRYPTHASH h;
\xml-security\c\src\enc\WinCAPI\WinCAPICryptoKeyRSA.cpp(369):
HCRYPTHASH h;

It looks like these local objects never get freed by
CryptDestroyHash().. on failure or success!

There is a wrapper "class" WinCAPICryptoHash, but I don't think it was
intended for the purpose of resource management.  With some simple
changes it could do the job.  It looks like a resource wrapper is the
best option, as many of the fn()'s that use the HCRYPTHASH can terminate
early by throw'ing errors.

Hope this helps

Steve







Mime
View raw message