memory leak in SECMOD_AddModule()

RESOLVED FIXED in 3.4

Status

NSS
Libraries
P2
normal
RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: Jeff Hostetler, Assigned: Robert Relyea)

Tracking

({memory-leak})

x86
Windows 2000
memory-leak

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
in security/nss/lib/pk11wrap/pk11util.c::SECMOD_AddModule(),
the call to _FindModule() returns a 'referenced' module.  this
return value is discarded and hence the reference count is off
and the module gets leaked later during cleanup.

consider adding the following change:

#if 1//begin JLH fix
    SECMODModule * pOldModule = SECMOD_FindModule(newModule->commonName);
    if (pOldModule) {
	/* _FindModule() increased the ref count, so we need to undo it. */
	SECMOD_DestroyModule(pOldModule);
        return SECWouldBlock;
        /* module already exists. */
    }
#else //the old way
    if (SECMOD_FindModule(newModule->commonName)) {
        return SECWouldBlock;
        /* module already exists. */
    }
#endif//end JLH fix

Comment 1

17 years ago
Need review of patch. thanks for the patch reporter.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: mlk, patch, review

Comment 2

17 years ago
Assigned the bug to Bob.
Assignee: wtc → relyea

Updated

17 years ago
Blocks: 92580

Updated

17 years ago
No longer blocks: 92580
Depends on: 104741

Updated

17 years ago
Priority: -- → P2
Target Milestone: --- → 3.4
(Assignee)

Comment 3

17 years ago
Fixed in NSS 3.4
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.