[rfc][icedtea-web] Fix many memory leaks due to utf8fromidentifier misuse

Pavel Tisnovsky ptisnovs at redhat.com
Mon Jul 29 07:52:58 PDT 2013


Hi Adam,

this change (incl. refactoring) looks correct, ok for HEAD.

Thanks
Pavel

----- Adam Domurad <adomurad at redhat.com> wrote:
> Hi all. Every single occurrence of utf8fromidentifier requires a call to 
> 'memfree' after being used. This patch addresses this (there were around 
> 40 occurrences).
> 
> Some minor refactoring was bundled, sorry. It is hard not to bundle 
> clean-up to avoid making a mess.
> 
> Most notably name->name_id in many places, to allow for use of 'name' to 
> hold the actual string. As well string fiddling was reduced in some places.
> 
> A minor test is included in the changeset.
> 
> ChangeLog:
> 2013-06-24  Adam Domurad  <adomurad at redhat.com>
> 
>           * plugin/icedteanp/IcedTeaPluginUtils.cc
>           (NPIdentifierAsString): Leak-free utf8fromidentifier wrapper.
>           * plugin/icedteanp/IcedTeaPluginUtils.h: Same.
>           * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Update calls
>           * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same.
>           * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: Same.
>           * plugin/icedteanp/IcedTeaScriptablePluginObject.h: Same.
>           * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc
>           (NPIdentifierAsString): New, tests utility function
>           * tests/cpp-unit-tests/browser_mock.cc
>           (mock_utf8fromidentifier): New, mocks NPAPI function
> 
> Happy hacking,
> -Adam
> 




More information about the distro-pkg-dev mailing list