Closed
Bug 413424
Opened 16 years ago
Closed 16 years ago
PNG encoder leaks a string
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla1.9beta3
People
(Reporter: Dolske, Assigned: Dolske)
References
Details
(Keywords: memory-leak)
Attachments
(1 file)
1.52 KB,
patch
|
pavlov
:
review+
mtschrep
:
approval1.9+
|
Details | Diff | Splinter Review |
Caught this while looking at Solaris leaks with libumem. Doh, my bad, I wrote this code. :)
Attachment #298382 -
Flags: review?(pavlov)
Assignee | ||
Updated•16 years ago
|
Assignee: nobody → dolske
Target Milestone: --- → mozilla1.9 M11
Updated•16 years ago
|
Attachment #298382 -
Flags: review?(pavlov) → review+
Assignee | ||
Updated•16 years ago
|
Attachment #298382 -
Flags: approval1.9?
Comment 1•16 years ago
|
||
Comment on attachment 298382 [details] [diff] [review] Patch v.1 a1.9 Not sure whether to be angry you leaked or happy you fixed it :-).
Attachment #298382 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 2•16 years ago
|
||
Let's go with "happy". :-) Checking in modules/libpr0n/encoders/png/nsPNGEncoder.cpp; /cvsroot/mozilla/modules/libpr0n/encoders/png/nsPNGEncoder.cpp,v <-- nsPNGEncoder.cpp new revision: 1.7; previous revision: 1.6 done
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 3•16 years ago
|
||
Comment on attachment 298382 [details] [diff] [review] Patch v.1 >- char* options = nsCRT::strdup(PromiseFlatCString(NS_ConvertUTF16toUTF8(aOptions)).get()); For future reference, NS_ConvertXXXtoYYY is always flat, it has a .get() method, so no need for the PromiseFlat(C)String. >+ // Make a copy of aOptions, because strtok() will modify it. >+ nsCAutoString optionsCopy; >+ optionsCopy.Assign(NS_ConvertUTF16toUTF8(aOptions)); Here you can avoid one buffer copy if you use CopyUTF16toUTF8(aOptions, optionsCopy);
You need to log in
before you can comment on or make changes to this bug.
Description
•