Closed
Bug 110661
Opened 24 years ago
Closed 24 years ago
Leaking imap progress string
Categories
(MailNews Core :: Networking: IMAP, defect)
MailNews Core
Networking: IMAP
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: Bienvenu, Assigned: Bienvenu)
Details
(Keywords: memory-leak)
Attachments
(1 file, 2 obsolete files)
|
1.70 KB,
patch
|
hwaara
:
review+
sspitzer
:
superreview+
|
Details | Diff | Splinter Review |
[W] MLK: Memory leak of 48 bytes from 1 block allocated in PR_Malloc
Distribution of leaked blocks
Allocation location
malloc [dbgheap.c:129]
PR_Malloc [prmem.c:54]
nsMemoryImpl::Alloc(UINT) [nsMemoryImpl.cpp:320]
nsMemory::Alloc(UINT) [nsMemoryImpl.cpp:556]
AllocateStringCopy(nsAString const&,WORD *)
[nsReadableUtils.cpp:191]
ToNewUnicode(nsAString const&) [nsReadableUtils.cpp:251]
nsStringBundle::GetStringFromID(int,WORD * *)
[nsStringBundle.cpp:378]
nsImapIncomingServer::GetImapStringByID(int,WORD * *)
[nsImapIncomingServer.cpp:2058]
if (m_stringBundle)
{
PRUnichar *ptrv = nsnull;
=> res = m_stringBundle->GetStringFromID(aMsgId,
&ptrv);
if (NS_FAILED(res))
{
nsImapMailFolder::ProgressStatus(nsIImapProtocol *,UINT,WORD
const*) [nsImapMailFolder.cpp:4516]
{
nsCOMPtr<nsIImapServerSink> serverSink =
do_QueryInterface(server);
if (serverSink)
=> serverSink->GetImapStringByID(aMsgId, &progressMsg);
}
if (!progressMsg)
IMAPGetStringByID(aMsgId, &progressMsg);
ProgressStatusProxyEvent::HandleEvent(void)
[nsImapProxyEvent.cpp:1045]
| Assignee | ||
Comment 1•24 years ago
|
||
fix coming up.
| Assignee | ||
Comment 2•24 years ago
|
||
this leak happens when we have a formatted string to display status, e.g., when
you delete a message and it displays the "moving to folder %S" message
Keywords: nsbeta1+
| Assignee | ||
Comment 3•24 years ago
|
||
need to free progress string before assigning it.
Comment 4•24 years ago
|
||
Comment on attachment 58280 [details] [diff] [review]
proposed fix (and fix for annoying auto compact assertion on biff)
You could make progressMsg a nsXPIDLString.
Either way, r=hwaara
Attachment #58280 -
Flags: review+
Comment 5•24 years ago
|
||
nsXPIDLString will be more safe if someone add something here in future. All
those TextFormatter constructs can be cleaned up to use FormatStringFrom..,
probably we should have another bug for that.
| Assignee | ||
Comment 6•24 years ago
|
||
You'd have to rewrite the code to use an nsXPIDLString, or I would have done it.
| Assignee | ||
Comment 7•24 years ago
|
||
reviews, please. Again, like the other patch, I'm using the Length() == 0 check
instead of a null check because the null check will never be false for a local
variable.
Comment 8•24 years ago
|
||
Two things:
1. Maybe you should use .IsEmpty() instead of checking Length() for a 0 value?
2. Is there a reason for using .Adopt() instead of .Assign() (or just '=' the
value directly)?
| Assignee | ||
Comment 9•24 years ago
|
||
using '=' wont' compile, using .Assign doesn't run (probably because there's
already data in the string), and .Adopt both works, and has the advantage of
avoiding an extra copy and free.
Comment 10•24 years ago
|
||
Comment on attachment 58358 [details] [diff] [review]
new patch with IsEmpty
r=hwaara
Attachment #58358 -
Flags: review+
| Assignee | ||
Updated•24 years ago
|
Attachment #58280 -
Attachment is obsolete: true
Comment 11•24 years ago
|
||
Comment on attachment 58358 [details] [diff] [review]
new patch with IsEmpty
sr=sspitzer
Attachment #58358 -
Flags: superreview+
| Assignee | ||
Updated•24 years ago
|
Attachment #58356 -
Attachment is obsolete: true
| Assignee | ||
Comment 12•24 years ago
|
||
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified FIXED.
m_stringBundle didn't show up in any of my expanded Purify logs on Windows 2000
with the latest trunk build (IMAP).
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: MailNews → Core
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•