nsCmdLineService is leaky.

RESOLVED FIXED

Status

Core Graveyard
Cmd-line Features
P3
major
RESOLVED FIXED
19 years ago
9 years ago

People

(Reporter: Bruce Mitchener, Assigned: Mike Pinkerton (not reading bugmail))

Tracking

({memory-leak, verifyme})

Trunk
memory-leak, verifyme

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

19 years ago
nsCmdLineService::Initialize() does this type of thing:
mArgValueList.AppendElement((void *)PL_strdup(aArgv[0]));

Yet, the things stuffed into mArgValueList and mArgList are never freed!

Please free them.
Status: NEW → ASSIGNED
Target Milestone: --- → M17

Comment 1

18 years ago
Move to M20 target milestone.
Target Milestone: M17 → M21
(Reporter)

Comment 2

18 years ago
Another one for the boring hours of the morning .....  

Comment 3

18 years ago
don: you said m20 but you targetted m21.  retargetting to 20
Target Milestone: M21 → M20

Comment 4

18 years ago
cc'ing shaver, as bruce tried to do before mid-air collision removed it
(Assignee)

Comment 6

18 years ago
i've attached a patch. piece o cake.
Keywords: patch
(Assignee)

Comment 7

18 years ago
Created attachment 9193 [details] [diff] [review]
patch, take 2 (now deletes array[0])
(Assignee)

Comment 8

18 years ago
Created attachment 9195 [details] [diff] [review]
take 3, now it's right.
(Assignee)

Comment 9

18 years ago
dear god i am an idiot. 
(Assignee)

Comment 10

18 years ago
Created attachment 9196 [details] [diff] [review]
oh dear god, i am an idiot. _now_ it's right.
(Assignee)

Comment 11

18 years ago
sorry folks, my hands and my brain aren't one this morning. make sure i eat my 
wheaties before you let me submit another patch, ok?!
1.  Why is PL_strdup mixed with nsCRT::strdup?  Yeesh.

2.  What happens if one of those strdup calls fails?  You'll store null; should
you check and fail with NS_ERROR_OUT_OF_MEMORY?  If not, will the destructor's
calls to nsAllocator::Free safely do nothing when passed null?

/be
(Assignee)

Comment 13

18 years ago
taking over.
Assignee: radha → pinkerton
Status: ASSIGNED → NEW
(Assignee)

Comment 14

18 years ago
fix checked in.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Updated

17 years ago
Component: XP Utilities → XP Apps: Cmd-line Features
Keywords: verifyme
QA Contact: rickg → jrgm
Summary: MLK: nsCmdLineService is leaky. → nsCmdLineService is leaky.

Updated

9 years ago
Component: Cmd-line Features → Cmd-line Features
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.