Bug 37598

Summary: [Qt] tst_QScriptValue::toString has a memory leak.
Product: WebKit Reporter: Jędrzej Nowacki <jedrzej.nowacki>
Component: JavaScriptCoreAssignee: Jędrzej Nowacki <jedrzej.nowacki>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jedrzej.nowacki, kenneth, kent.hansen
Priority: P1 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 31863    
Attachments:
Description Flags
Fix v1 none

Description Jędrzej Nowacki 2010-04-14 12:57:28 PDT
Valgrind report a memory leak inside the QScriptValue::toString autotest. It seems that a temporary variable is not released.

==5038==    at 0x4C221A7: malloc (vg_replace_malloc.c:195)                                                                                                                                           
==5038==    by 0x50BCB38: WTF::fastMalloc(unsigned long) (FastMalloc.cpp:249)                                                                                                                        
==5038==    by 0x50072DD: WTF::FastAllocBase::operator new(unsigned long) (FastAllocBase.h:96)                                                                                                       
==5038==    by 0x5020833: OpaqueJSString::create(unsigned short const*, unsigned int) (OpaqueJSString.h:45)                                                                                          
==5038==    by 0x5020493: JSStringCreateWithUTF8CString (JSStringRef.cpp:50)                                                                                                                         
==5038==    by 0x4FFFF34: QScriptConverter::toString(QString const&) (qscriptconverter_p.h:59)                                                                                                       
==5038==    by 0x50000C1: QScriptEnginePrivate::makeJSValue(QString const&) const (qscriptengine_p.h:112)                                                                                            
==5038==    by 0x50036C1: QScriptValuePrivate::QScriptValuePrivate(QScriptEngine const*, QString const&) (qscriptvalue_p.h:284)                                                                      
==5038==    by 0x5001CE1: QScriptValue::QScriptValue(QScriptEngine*, QString const&) (qscriptvalue.cpp:162)                                                                                          
==5038==    by 0x414952: tst_QScriptValue::initScriptValues() (tst_qscriptvalue_generated.cpp:112)                                                                                                   
==5038==    by 0x41F8CC: tst_QScriptValue::toString_initData() (tst_qscriptvalue_generated.cpp:667)                                                                                                  
==5038==    by 0x405C0E: tst_QScriptValue::dataHelper(void (tst_QScriptValue::*)(), void (tst_QScriptValue::*)(char const*)) (tst_qscriptvalue.cpp:36)
Comment 1 Jędrzej Nowacki 2010-04-14 13:36:44 PDT
Created attachment 53360 [details]
Fix v1
Comment 2 WebKit Commit Bot 2010-04-14 19:58:21 PDT
Comment on attachment 53360 [details]
Fix v1

Clearing flags on attachment: 53360

Committed r57625: <http://trac.webkit.org/changeset/57625>
Comment 3 WebKit Commit Bot 2010-04-14 19:58:26 PDT
All reviewed patches have been landed.  Closing bug.