Closed Bug 658092 Opened 13 years ago Closed 8 years ago

Leak of nssTrust in STAN_DeleteCertTrustMatchingSlot

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1281724

People

(Reporter: mattm, Unassigned)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
STAN_DeleteCertTrustMatchingSlot calls nssTrustDomain_FindTrustForCertificate which calls and returns a value from nssTrust_Create.  The nssTrust value is never freed.

A patch to free it is attached.

valgrind log (note nssTrust_Create does not show up in the stack because the object is created in the nssPKIObject's arena):

==16516== 27,131 bytes in 13 blocks are possibly lost in loss record 3,971 of 3,981
==16516==    at 0x402A40B: malloc (vg_replace_malloc.c:904)
==16516==    by 0x7AA1F86: PR_Malloc (prmem.c:467)
==16516==    by 0x420142F: PL_ArenaAllocate (plarena.c:225)
==16516==    by 0x40F4620: nss_zalloc_arena_locked (arena.c:833)
==16516==    by 0x40F47BB: nss_ZAlloc (arena.c:929)
==16516==    by 0x40E7CAD: nssPKIObject_Create (pkibase.c:140)
==16516==    by 0x40E487E: nssTrustDomain_FindTrustForCertificate (trustdomain.c:1124)
==16516==    by 0x40EBF9A: STAN_DeleteCertTrustMatchingSlot (pki3hack.c:1280)
==16516==    by 0x40DAB1A: SEC_DeletePermCertificate (stanpcertdb.c:101)
==16516==    by 0x974DE0: _ZN3net12CertDatabase16DeleteCertAndKeyEPKNS_15X509CertificateE (cert_database_nss.cc:264)
==16516==    by 0x41FF0C: _ZN3net12_GLOBAL__N_119CleanupSlotContentsEP15PK11SlotInfoStr (cert_database_nss_unittest.cc:72)
==16516==    by 0x429F27: _ZN3net19CertDatabaseNSSTest8TearDownEv (cert_database_nss_unittest.cc:124)
==16516==    by 0xCDB754: _ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc (gtest.cc:2090)
==16516==    by 0xCD8D0D: _ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc (gtest.cc:2142)
==16516==    by 0xCCE05C: _ZN7testing4Test3RunEv (gtest.cc:2170)
==16516==    by 0xCCE837: _ZN7testing8TestInfo3RunEv (gtest.cc:2338)
==16516==    by 0xCCEF2D: _ZN7testing8TestCase3RunEv (gtest.cc:2445)
==16516==    by 0xCD3D4A: _ZN7testing8internal12UnitTestImpl11RunAllTestsEv (gtest.cc:4237)
==16516==    by 0xCDC57B: _ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS0_12UnitTestImplEbEET0_PT_MS4_FS3_vEPKc (gtest.cc:2090)
==16516==    by 0xCD94BC: _ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS0_12UnitTestImplEbEET0_PT_MS4_FS3_vEPKc (gtest.cc:2142)
==16516==    by 0xCD285B: _ZN7testing8UnitTest3RunEv (gtest.cc:3874)
==16516==    by 0x1291722: _ZN4base9TestSuite3RunEv (test_suite.cc:131)
==16516==    by 0x512C6D: main (run_all_unittests.cc:24)
It looks like this was fixed as part of Bug 1281724:
https://hg.mozilla.org/projects/nss/rev/52c28c890e14#l4.34
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: