Memory leaks via PK11_ListCerts

RESOLVED DUPLICATE of bug 291228

Status

NSS
Libraries
RESOLVED DUPLICATE of bug 291228
13 years ago
12 years ago

People

(Reporter: Simon Fraser, Unassigned)

Tracking

({memory-leak})

memory-leak

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
I'm seeing a lot of memory leaks via a call to PK11_ListCerts(). The leak stacks look like:

		PK11_ListCerts
		NSSTrustDomain_TraverseCertificates
		nssPKIObjectCollection_Traverse
		pk11ListCertCallback
		STAN_GetCERTCertificateName
		get_cert_instance
		nssCryptokiObject_Clone
		nssUTF8_Duplicate
		nss_ZAlloc
		PR_Calloc 

My guess is that the leak is in STAN_GetCERTCertificateName(): does 'instance' need to be destroyed?

http://lxr.mozilla.org/mozilla/source/security/nss/lib/pki/pki3hack.c#693

Updated

13 years ago
Whiteboard: [kerh-coa]

Updated

13 years ago
Keywords: mlk

Comment 1

12 years ago
I think this is an NSS bug?
Assignee: kengert → nobody
Component: Security: PSM → Libraries
Product: Core → NSS
QA Contact: libraries
Whiteboard: [kerh-coa]
Version: Trunk → 3.0
Simon, is this a duplicate of bug 291228 ?

Comment 3

12 years ago
Simon seems right. I think STAN_GetCERTCertificateName should
destroy 'instance' because fill_CERTCertificateFields, the
other caller of get_cert_instance, destroys 'instance':

char * 
STAN_GetCERTCertificateName(PLArenaPool *arenaOpt, NSSCertificate *c)
{
    nssCryptokiInstance *instance = get_cert_instance(c);
    char *nickname;
    nickname = STAN_GetCERTCertificateNameForInstance(arenaOpt, c, instance);
    if (instance) {
        nssCryptokiObject_Destroy(instance);
    }
    return nickname;
}

Comment 4

12 years ago
Nelson, this bug is indeed a duplicate of bug 291228.

*** This bug has been marked as a duplicate of 291228 ***
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.