Closed Bug 118639 Opened 24 years ago Closed 24 years ago

fix leaks in nsFTPDirListingConv.cpp

Categories

(Core Graveyard :: Networking: FTP, defect)

x86
FreeBSD
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: pete, Assigned: pete)

Details

Attachments

(4 files, 1 obsolete file)

fix leaks and clean up file some. --pete
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.9
Please review.
Keywords: review
Comment on attachment 68423 [details] [diff] [review] patch to fix leaks >Index: nsFTPDirListingConv.cpp > escName = nsEscape(aLine, url_Path); >- aEntry->mName = escName; >+ aEntry->mName.Adopt(escName); > nsMemory::Free(escName); crash! > escName = nsEscape(ptr+1, url_Path); >- aEntry->mName = escName; >+ aEntry->mName.Adopt(escName); > nsMemory::Free(escName); crash! etc... you're asking a string class to adopt a pointer, but then you free it?!? if you're going to Adopt then don't Free. ie, the string class subsumes ownership of the string when you ask it to adopt a character pointer.
Attachment #68423 - Flags: needs-work+
duh, I should have looked at things closer. Sorry. --pete
Comment on attachment 68459 [details] [diff] [review] removing calls to Free >Index: nsFTPDirListingConv.cpp >- thisEntry->mName = escName; >+ thisEntry->mName.Adopt(escName); > } >- nsMemory::Free(escName); how about cleaning up the indentation before checking in? with that, sr=darin
Attachment #68459 - Flags: superreview+
Comment on attachment 68536 [details] [diff] [review] expanded tabs in file and cleaned up some intentation r=dougt, sr=carried over from darin.
Attachment #68536 - Flags: superreview+
Attachment #68536 - Flags: review+
checked in --pete
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment on attachment 68536 [details] [diff] [review] expanded tabs in file and cleaned up some intentation >@@ -1083,7 +1076,6 @@ > char *escapedDate = nsEscape(buffer, url_Path); > > aString.Append(escapedDate); >- nsMemory::Free(escapedDate); > aString.Append(' '); > Doesn't this leak? You're not .Adopt()ing that one....
Attached patch Damn, thanks for catching that (obsolete) — Splinter Review
Attachment #68720 - Attachment is obsolete: true
Comment on attachment 68721 [details] [diff] [review] uh, wrong one, ignore previous patch r=me
Attachment #68721 - Flags: review+
Reopening to check in this fix. --pete
Darin, l inadvertantly removed a needed nsMemory::Free. can you sr this? Thanks --pete
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 68721 [details] [diff] [review] uh, wrong one, ignore previous patch sr=darin
Attachment #68721 - Flags: superreview+
a=asa (on behalf of drivers) for checkin to 0.9.9
Keywords: mozilla0.9.9+
Checked in. --pete
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
1.68pete%alphanumerica.comFeb 22 16:41 b=118639, r=bbaetz, sr=darin, a=asa inadvertantly removed a needed nsMemory::Free when cleaning up leaks in this file. --pete
Status: RESOLVED → VERIFIED
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: