Valgrind output: ==4741== 8 bytes in 2 blocks are definitely lost in loss record 9 of 121 ==4741== at 0x4015DD24: malloc (vg_clientfuncs.c:100) ==4741== by 0x40288884: PR_Malloc (../../../../../nsprpub/pr/src/malloc/prmem.c:433) ==4741== by 0x41950DB4: nsMemoryImpl::Alloc(unsigned) (../../../xpcom/base/nsMemoryImpl.cpp:319) ==4741== by 0x806BBE3: nsMemory::Alloc(unsigned) (nsMemory.cpp:87) ==4741== by 0x44078E5A: nsWindow::SetTitle(nsString const&) (../../../../widget/src/gtk/nsWindow.cpp:2381) The problem is that we allocate platformText if the length returned by GetMaxLength() is > 0, but we only free it if the length returned by Convert() is also > 0. This is not always the case.
Created attachment 116013 [details] [diff] [review] patch Fix the leak, plus quiet a compiler warning about platformText potentially being used uninitialized. I don't think any of the other platform widget code is affected by this.
Comment on attachment 116013 [details] [diff] [review] patch r+sr=blizzard Go ahead and check it in.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.