Memory leak of 9 bytes from 1 block allocated in nsMsgIMAPFolderACL::nsMsgIMAPFolderACL

RESOLVED FIXED

Status

MailNews Core
Networking: IMAP
--
minor
RESOLVED FIXED
16 years ago
9 years ago

People

(Reporter: stephend@netscape.com (gone - use stephen.donner@gmail.com instead), Assigned: Mikael Parknert)

Tracking

({mlk})

Trunk
x86
Windows 2000

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Build ID: Latest win32 tip (pulled after David's monster checkin to our URI 
code), under Purify.

Steps to Reproduce:

1.  Just launch an IMAP account (with no new messages).
2.  Shutdown.

[W] MLK: Memory leak of 9 bytes from 1 block allocated in PL_strdup
    Distribution of leaked blocks
         9 bytes from 1 block of 9 bytes (0x09311048) 
    Allocation location
    malloc         [MSVCRT.DLL]
    PL_strdup      [strdup.c:46]
    nsMsgIMAPFolderACL::SetFolderRightsForUser(char const*,char const*) 
[nsImapMailFolder.obj:4992]
    nsMsgIMAPFolderACL::BuildInitialACLFromCache(void) 
[nsImapMailFolder.obj:4931]
    nsMsgIMAPFolderACL::nsMsgIMAPFolderACL(nsImapMailFolder *) 
[nsImapMailFolder.cpp:4896]
      m_folder = folder;
      m_rightsHash = new nsHashtable(24);
      m_aclCount = 0;
 =>   BuildInitialACLFromCache();
    }
    
    nsMsgIMAPFolderACL::~nsMsgIMAPFolderACL()
    nsImapMailFolder::ClearFolderRights(nsIImapProtocol *,nsIMAPACLRightsInfo 
*) [nsImapMailFolder.cpp:4468]
    {
      SetFolderNeedsACLListed(PR_FALSE);
      delete m_folderACL;
 =>   m_folderACL = new nsMsgIMAPFolderACL(this);
      return NS_OK;
    }
    
    ClearFolderRightsProxyEvent::HandleEvent(void) [nsImapProxyEvent.cpp:602]
    
    NS_IMETHODIMP
    ClearFolderRightsProxyEvent::HandleEvent()
     => {
            nsresult res = m_proxy->m_realImapExtensionSink->ClearFolderRights(
                m_proxy->m_protocol, &m_aclRightsInfo);
            if (m_notifyCompletion)
    nsImapEvent::imap_event_handler(PLEvent *) [nsImapProxyEvent.cpp:90]
        nsImapEvent::imap_event_handler(PLEvent *aEvent)
        {
                nsImapEvent* ev = (nsImapEvent*) aEvent;
     =>         ev->HandleEvent();
        }
        
        void PR_CALLBACK
    PL_HandleEvent [plevent.c:590]
    PL_ProcessPendingEvents [plevent.c:520]
    md_EventReceiverProc [plevent.c:1071]
    DestroyWindow  [USER32.dll]
    TranslateMessageEx [USER32.dll]
    DispatchMessageA [USER32.dll]
    DispatchMessageA [USER32.DLL]
    nsAppShell::Run(void) [nsAppShell.cpp:114]
    nsAppShellService::Run(void) [nsAppShellService.cpp:307]
    main1          [nsAppRunner.cpp:1288]
    main           [nsAppRunner.cpp:1636]
    WinMain        [nsAppRunner.cpp:1654]
Keywords: mlk
QA Contact: huang → stephend

Comment 1

16 years ago
taking
Assignee: mscott → bienvenu
Product: MailNews → Core
(Assignee)

Comment 2

13 years ago
Looking at the code from time of bug report shows that a failed PL_strdup
might trigger a leak. Since then code has been changed, but if
'ourUserName' is empty we would get a leak.. Attaching a fix.

Assignee: bienvenu → mikael
(Assignee)

Comment 3

13 years ago
Created attachment 170121 [details] [diff] [review]
fix
(Assignee)

Updated

13 years ago
Attachment #170121 - Flags: superreview?(bienvenu)
Attachment #170121 - Flags: review?(dmose)

Updated

13 years ago
Attachment #170121 - Flags: superreview?(bienvenu) → superreview+

Comment 4

13 years ago
Comment on attachment 170121 [details] [diff] [review]
fix

r=dmose
Attachment #170121 - Flags: review?(dmose) → review+
Fix checked in for 1.8b 
(Assignee)

Updated

13 years ago
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.