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

Adam Domurad adomurad at redhat.com
Tue Jun 25 07:11:19 PDT 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: plugin-utf8fromidentifier-fix-leaks.patch
Type: text/x-patch
Size: 33296 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130625/344b304b/plugin-utf8fromidentifier-fix-leaks.patch 


More information about the distro-pkg-dev mailing list