Bug 85886 - [GTK] Memory leak in DRT EventSender.cpp
Summary: [GTK] Memory leak in DRT EventSender.cpp
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sudarsana Nagineni (babu)
Depends on:
Reported: 2012-05-08 08:34 PDT by Sudarsana Nagineni (babu)
Modified: 2012-05-08 10:14 PDT (History)
2 users (show)

See Also:

patch (1.58 KB, patch)
2012-05-08 09:12 PDT, Sudarsana Nagineni (babu)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sudarsana Nagineni (babu) 2012-05-08 08:34:40 PDT
Valgrind report a memory leak inside the gdkModifersFromJSValue(). It seems JSString created with JSStringCreateWithUTF8CString needs to be released.

==19010== 240 bytes in 20 blocks are indirectly lost in loss record 10,113 of 11,527
==19010==    at 0x4C2AC27: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19010==    by 0x5219944: OpaqueJSString::OpaqueJSString(unsigned short const*, unsigned int) (OpaqueJSString.h:69)
==19010==    by 0x5219881: OpaqueJSString::create(unsigned short const*, unsigned int) (OpaqueJSString.h:46)
==19010==    by 0x5219581: JSStringCreateWithUTF8CString (JSStringRef.cpp:50)
==19010==    by 0x4635E1: gdkModifersFromJSValue(OpaqueJSContext const*, OpaqueJSValue const*) (EventSender.cpp:301)
==19010==    by 0x4647DC: createKeyPressEvent(OpaqueJSContext const*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) (EventSender.cpp:622)
==19010==    by 0x464F30: keyDownCallback(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) (EventSender.cpp:760)
==19010==    by 0x51FBA93: JSC::JSCallbackFunction::call(JSC::ExecState*) (JSCallbackFunction.cpp:73)
==19010==    by 0x53874C9: cti_op_call_NotJSFunction (JITStubs.cpp:2312)
==19010==    by 0x5382C7B: JSC::JITThunks::tryCacheGetByID(JSC::ExecState*, JSC::CodeBlock*, JSC::ReturnAddressPtr, JSC::JSValue, JSC::Identifier const&, JSC::PropertySlot const&, JSC::StructureStubInfo*)
==19010==    by 0x7FEFFDF8F: ???
Comment 1 Sudarsana Nagineni (babu) 2012-05-08 09:12:04 PDT
Created attachment 140726 [details]

Fix a memory leak
Comment 2 WebKit Review Bot 2012-05-08 10:14:01 PDT
Comment on attachment 140726 [details]

Clearing flags on attachment: 140726

Committed r116434: <http://trac.webkit.org/changeset/116434>
Comment 3 WebKit Review Bot 2012-05-08 10:14:06 PDT
All reviewed patches have been landed.  Closing bug.