Closed Bug 1205767 Opened 5 years ago Closed 5 years ago

the memory returned by calls to decode_ec_params in nsKeygenHandler.cpp is leaked

Categories

(Core :: Security: PSM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox43 --- affected
firefox44 --- fixed

People

(Reporter: keeler, Assigned: keeler)

Details

Attachments

(1 file)

decode_ec_params allocates memory and returns it. The caller (nsKeygenFormProcessor::GetPublicKey) never frees it, but it does pass it in to PK11_GenerateKeyPairWithFlags. It may be that the memory is reachable from what PK11_GenerateKeyPairWithFlags returns and is appropriately cleaned up when that gets cleaned up, but I doubt it.
Looking closer (and consulting similar code), it appears this memory is in fact leaked.
Summary: investigate if the calls to decode_ec_params in nsKeygenHandler.cpp leak memory → the memory returned by calls to decode_ec_params in nsKeygenHandler.cpp is leaked
bug 1205767 - prevent memory leak when generating an EC key with <keygen> r?ttaubert
Attachment #8667476 - Flags: review?(ttaubert)
Assignee: nobody → dkeeler
Attachment #8667476 - Flags: review?(ttaubert) → review+
Comment on attachment 8667476 [details]
MozReview Request: bug 1205767 - prevent memory leak when generating an EC key with <keygen> r?ttaubert

https://reviewboard.mozilla.org/r/20761/#review18703

Yeah, that seems the right thing to do. Happy to give r+, but I'm unfortunately not a peer.
Thanks for the review. Since I'm a peer, I delegated the review to you :)
https://hg.mozilla.org/mozilla-central/rev/7516ef9430ee
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.