Closed Bug 157927 Opened 22 years ago Closed 22 years ago

Fix memory leaks in nsNSSCertificate.cpp

Categories

(Core Graveyard :: Security: UI, defect)

Other Branch
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: KaiE, Assigned: KaiE)

References

Details

Attachments

(1 file, 2 obsolete files)

nsNSSCertificate.cpp seems to leak. I see calls to CERT_GetCommonName or CERT_GetOrgName, and there are probably many others, where the return code has been allocated by NSS, but PSM fails to free the memory.
Blocks: psmleaks
I think I have fixed most of the leaks with the patch for bug 121916.
Keywords: nsbeta1
Wrong bug number in previous statement. Correction: I think I have fixed most of the leaks with the patch for bug 124037.
Assignee: ssaux → kaie
Depends on: 124037
I looked again, and I actually found more leaks. In addition, I want to get rid of the compiler warnings PSM produces. - signed mismatch on comparison - cleaned up the code in nsNSSCallbacks.cpp to avoid a leak on error - temporarily #if 0 out more code, sigh. The disabled code was reported as being defined but unused. There is some code in that file that say "XXX should get reenabled", but it does not say why. I don't want to remove that code completely before I have a chance to understand it. - change a nsXPIDLCString to a nsCString to get rid of an evil looking "synthesized class for assignment" compiler warning
Status: NEW → ASSIGNED
Attached patch Patch v1 (obsolete) — Splinter Review
Javi, can you please review?
Attachment #94215 - Flags: review+
Comment on attachment 94215 [details] [diff] [review] Patch v1 ignoring whitespace, please review this one r=javi Is that one chunk in nsNSSIOLayer.cpp that you commented out really not called from anywhere?
No, that block is not called from anywhere. The single entry point to all the #ifdef'ed functions is CERT_MatchesScopeOfUse. There are two calls to that function that are already disabled and marked with "XXX fixme".
Alec, can you please review?
Comment on attachment 94215 [details] [diff] [review] Patch v1 ignoring whitespace, please review this one >Index: mozilla/security/manager/ssl/src/nsKeygenHandler.cpp >=================================================================== >RCS file: /cvsroot/mozilla/security/manager/ssl/src/nsKeygenHandler.cpp,v >retrieving revision 1.15 >diff -u -d -w -b -B -r1.15 nsKeygenHandler.cpp >--- mozilla/security/manager/ssl/src/nsKeygenHandler.cpp 15 May 2002 18:54:55 -0000 1.15 >+++ mozilla/security/manager/ssl/src/nsKeygenHandler.cpp 6 Aug 2002 19:12:20 -0000 >@@ -623,7 +623,6 @@ > nsString& aAttribute) > { > nsString selectKey; >- SECKeySizeChoiceInfo *choice = SECKeySizeChoiceList; > > selectKey.Assign(NS_LITERAL_STRING("SELECT")); > if (Compare(aFormType, NS_LITERAL_STRING("SELECT"), It looks like selectKey is unused and can be removed. You could also change aAttribute.AssignWithConversion(mozKeyGen); to aAttribute.Assign(NS_LITERAL_STRING("-mozilla-keygen")); sr=jag with those change (and without, but since you seem to be doing some generic clean-up here anyway)
Attachment #94215 - Flags: superreview+
Attached patch Patch v2Splinter Review
This patch includes Jag's suggestions.
Attachment #94215 - Attachment is obsolete: true
Attachment #94216 - Attachment is obsolete: true
Attachment #96440 - Flags: superreview+
Attachment #96440 - Flags: review+
Comment on attachment 96440 [details] [diff] [review] Patch v2 carrying forward reviews
fixed on trunk
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Verified per kaie's comment.
Status: RESOLVED → VERIFIED
Product: PSM → Core
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: