[Webkit-unassigned] [Bug 118505] Leak: TextCodecICU::registerCodecs is leaking

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 9 09:38:21 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=118505





--- Comment #3 from Brian Holt <brian.holt at samsung.com>  2013-07-09 09:40:22 PST ---
(In reply to comment #2)
> (From update of attachment 206319 [details])
> I think that the leak may be real, but the fix is not right.
> 
> Generally, these strings are permanently stored in textCodecMap, and not leaked. One case where a leak may occur is when the same webStandardName is registered multiple times - when this happens, map value is thrown away.
> 
> However, I don't think that it's correct to remove fastStrDup. The result of ucnv_getCanonicalName is not documented to remain useful indefinitely - for example, they may be reusing a static buffer. So, we need our own copy of the string.

Thanks for your comments.  It seems that there might be some inconsistency in the way that the memory is handled.  If we need our own copy of the string, should we also make a copy of canonicalConverterName on line 193?

And if we're making copies then should the responsibility fall to TextCodecMap to free the additional data? But the additionalData is const implying (at least to me) that the TextCodecMap doesn't own that data.  

What would you suggest would be the best way to address the leak?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list