MLK: Memory leak of 48 bytes from 4 blocks allocated in nsImapMailFolder::GetPath(nsIFileSpec * *)

VERIFIED FIXED

Status

MailNews Core
Backend
VERIFIED FIXED
17 years ago
10 years ago

People

(Reporter: Navin Gupta, Assigned: Navin Gupta)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

17 years ago
Distribution of leaked blocks 48 bytes from 4 blocks of 12 bytes (first block: 
0x14d38670) 
        Allocation location
            new(UINT)+0xc        [new.cpp:23 ip=0x002da05c]
            nsImapMailFolder::GetPath(nsIFileSpec * *)+0x4e 
[nsImapMailFolder.cpp:4377 ip=0x099fb19e]
            nsImapMailFolder::GetSubFolders(nsIEnumerator * *)+0x122 
[nsImapMailFolder.cpp:483 ip=0x099d85d2]
            nsMsgFolderDataSource::createFolderChildNode(nsIMsgFolder 
*,nsIRDFNode * *)+0xbe [nsMsgFolderDataSource.cpp:1694 ip=0x0955678e]
            nsMsgFolderDataSource::createFolderNode(nsIMsgFolder 
*,nsIRDFResource *,nsIRDFNode * *)+0x974 [nsMsgFolderDataSource.cpp:986 
ip=0x09551ad4]
            nsMsgFolderDataSource::GetTarget(nsIRDFResource *,nsIRDFResource 
*,int,nsIRDFNode * *)+0x111 [nsMsgFolderDataSource.cpp:332 ip=0x0954c971]
            CompositeDataSourceImpl::GetTarget(nsIRDFResource *,nsIRDFResource 
*,int,nsIRDFNode * *)+0x2e9 [nsCompositeDataSource.cpp:816 ip=0x0a453c69]
            nsXULTemplateBuilder::CheckContainer(nsIRDFResource *,int *,int 
*)+0x2e2 [nsXULTemplateBuilder.cpp:1299 ip=0x0565bf64]
            nsXULContentBuilder::BuildContentFromTemplate(nsIContent 
*,nsIContent *,nsIContent *,int,nsIRDFResource *,int,nsTemplateMatch 
*,nsIContent * *,int *)+0x1e3b [nsXULContentBuilder.cpp:655 ip=0x05625dfb]
            nsXULContentBuilder::BuildContentFromTemplate(nsIContent 
*,nsIContent *,nsIContent *,int,nsIRDFResource *,int,nsTemplateMatch 
*,nsIContent * *,int *)+0x14f1 [nsXULContentBuilder.cpp:597 ip=0x056254b1]
(Assignee)

Comment 1

17 years ago
Created attachment 45849 [details] [diff] [review]
proposed fix
(Assignee)

Comment 2

17 years ago
free the memory in the destructor. cc bienvenu for review. 

Comment 3

17 years ago
r=hwaara

Comment 4

17 years ago
you don't need to check if a pointer is null before deleting it.
(Assignee)

Comment 5

17 years ago
Created attachment 45866 [details] [diff] [review]
patch

Comment 6

17 years ago
sr=bienvenu
(Assignee)

Comment 7

17 years ago
fix checked in.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
OS: Windows NT → All
QA Contact: esther → stephend
Hardware: PC → All
Verified FIXED.  If we have a null m_pathName, then we just delete that object.
Used LXR (purify is currently broken).  Naving got this from a Purify log I had,
next time I run purify I'll log the leaks I see, so we'll catch this if it
regresses again with any new code.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.