Last Comment Bug 107593 - Memory Leak in NSS (PK 11)
: Memory Leak in NSS (PK 11)
Product: NSS
Classification: Components
Component: Libraries (show other bugs)
: 3.3
: Sun Solaris
P1 normal (vote)
: 3.3.2
Assigned To: Robert Relyea
: Sonja Mirtitsch
Depends on:
  Show dependency treegraph
Reported: 2001-10-30 11:55 PST by Michael Hein
Modified: 2001-11-07 17:00 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---


Description User image Michael Hein 2001-10-30 11:55:48 PST
From bugsplat:

               malloc         [rtlib.o]
               calloc         [rtlib.o]
               PR_Calloc      [prmem.c:64]
               PORT_ZAlloc    [utilsecport.c:152]
               pk11_pbe_decode [pk11wrappk11slot.c:3352]
               PK11_ParamFromAlgid [pk11wrappk11slot.c:3510]
               PK11_PBEKeyGen [pk11wrappk11skey.c:4075]

The leak here is because the SECITEM_ZFreeItem free the Mech->data but this is
already a structure with More indirections... The salt is not freed and leaks 36
bytes every call.

------- Additional Comments From wtc  Oct-30-2001 06:56 ------- 

We don't use scopus/bugsplat for NSS bugs any more.
The NSS bug database is now

Would you mind filing this bug at
You'll need to go to
to open a Bugzilla account for yourself first.  Then
go to to file
a bug report against NSS.

Thank you!

------- Additional Comments From mhein  Oct-30-2001 11:43 ------- 

I'll open the mozilla bug for you.
Comment 1 User image Wan-Teh Chang 2001-10-30 12:07:05 PST
Bob, could you please take a look at this memory leak
report and determine the "severity" of this leak?
Does the PK11_PBEKeyGen function get called many times
by a typical client of NSS?
Comment 2 User image Wan-Teh Chang 2001-10-31 17:07:55 PST
This memory leak should be evaluated for NSS 3.3.2.
Comment 3 User image Wan-Teh Chang 2001-11-07 10:22:06 PST
I got more information from the bug reporter.

The memory leak is an increasing memory leak. It leaks
every time he calls the PK11_PBEKeyGen function.
Comment 4 User image Robert Relyea 2001-11-07 10:38:57 PST
PBE keygen is not called very often in a 'typical' client. It is usually used to
unwrap private keys in pk12util, however I know a few people are using them to
generate fixed keys use to wrap passwords (usually to allow unattended restart).

I do have a fix for some memory leaks in the PBE code, and this one sounds
familiar, but they are on the 3.4 code base. I think the section it's in is
separable enough.
Comment 5 User image Robert Relyea 2001-11-07 16:31:19 PST
A fix is checked in to NSS_3_3_BRANCH. to pk11slot.c
Comment 6 User image Wan-Teh Chang 2001-11-07 17:00:39 PST
r=wtc. (pk11slot.c, rev.

Note You need to log in before you can comment on or make changes to this bug.