resource leak in nsImapMailFolder::CompactAll
Categories
(MailNews Core :: Networking: IMAP, defect)
Tracking
(thunderbird_esr102 unaffected)
Tracking | Status | |
---|---|---|
thunderbird_esr102 | --- | unaffected |
People
(Reporter: mkmelin, Assigned: mkmelin)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
*** CID 1507881: Resource leaks (RESOURCE_LEAK)
/comm/mailnews/imap/src/nsImapMailFolder.cpp: 1420 in nsImapMailFolder::CompactAll(nsIUrlListener *, nsIMsgWindow *)()
1414 rv = imapFolder->Expunge(l, aMsgWindow);
1415 if (NS_FAILED(rv)) {
1416 // Make sure expungeCount is kept in sync!
1417 l->OnStopRunningUrl(nullptr, rv);
1418 }
1419 }
CID 1507881: Resource leaks (RESOURCE_LEAK) Variable "l" going out of scope leaks the storage it points to.
1420 } else {
1421 // No expunging. Start the compaction immediately.
1422 doCompact();
1423 }
1424
1425 return NS_OK;
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Comment 2•2 years ago
|
||
Ahh... I think that's the static analysis not realising the listener if refcounted by the compact operations - it'll be destroyed automagically when the last compact finishes. It would be a leak if the folder list was empty. There's a check for that no-folders case, but I think your fix adding an extra explicit refptr is definitely the right way to go - thanks for that!
Assignee | ||
Updated•2 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/723c4ec60cc9
Fix resource leak in nsImapMailFolder::CompactAll. r=benc
Description
•