[Bug 20684] New: Memory leak in CryptGenKey/CryptDestroyKey?

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Nov 12 19:22:54 CST 2009


           Summary: Memory leak in CryptGenKey/CryptDestroyKey?
           Product: Wine
           Version: 1.1.32
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: download, source, testcase
          Severity: normal
          Priority: P2
         Component: rsaenh
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: dank at kegel.com

Created an attachment (id=24711)
 --> (http://bugs.winehq.org/attachment.cgi?id=24711)
minimal test showing problem

Chromium's unit_tests.exe's SignatureCreatorTest.BasicTest
seems to show a leak in CryptGenKey():

972 bytes in 1 blocks are definitely lost in loss record 836 of 921
   at RtlAllocateHeap (heap.c:1423)
   by ???
   by ???
   by ???
   by CryptGenKey (crypt.c:1434)
   by base::RSAPrivateKey::Create (rsa_private_key_win.cc:35)
   by SignatureCreatorTest_BasicTest_Test::TestBody

I've extracted a minimal test case into the attached patch.  
To repeat, apply the patch and then run the rsaenh test under valgrind.
It complains

972 bytes in 1 blocks are definitely lost in loss record 463 of 518
   at RtlAllocateHeap (heap.c:1423)
   by new_object (handle.c:362)
   by new_key (rsaenh.c:834)
   by RSAENH_CPGenKey (rsaenh.c:3064)
   by CryptGenKey (crypt.c:1434)
   by func_rsaenh (rsaenh.c:2546)
   by run_test (test.h:535)
   by main (test.h:585)

It seems the reference count of the generated key starts off one
too high, or something?

Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the wine-bugs mailing list