MLK: Memory leak of 144 bytes from 1 block allocated in PL_strdup

NEW
Unassigned

Status

MailNews Core
MIME
--
minor
17 years ago
7 years ago

People

(Reporter: Navin Gupta, Unassigned)

Tracking

({memory-leak})

Trunk
x86
Windows NT
memory-leak

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
Again fwding as inline....

        Distribution of leaked blocks
        Allocation location
        malloc         [dbgheap.c:129]
        PL_strdup      [strdup.c:46]
        nsCRT::strdup(char const*) [nsCRT.h:182]
        mime_bridge_create_draft_stream [mimedrft.cpp:2016]
            PR_FREEIF(mdd);
            return nsnull;
          }
     => 
          mdd->options->url = nsCRT::strdup(mdd->url_name);
          mdd->options->format_out = format_out;     // output format
          mdd->options->decompose_file_p = PR_TRUE; /* new field in 
MimeDisplayOptions */
        bridge_create_stream [nsStreamConverter.cpp:101]
        {
          if  ( (format_out == nsMimeOutput::nsMimeMessageDraftOrTemplate) ||
                (format_out == nsMimeOutput::nsMimeMessageEditorTemplate) )
     =>     return mime_bridge_create_draft_stream(newEmitter, newPluginObj2, 
uri, format_out);
          else
            return mime_bridge_create_display_stream(newEmitter, newPluginObj2, 
uri, format_out, whattodo,
                                                     aChannel);
        nsStreamConverter::Init(nsIURI *,nsIStreamListener *,nsIChannel *) 
[nsStreamConverter.cpp:740]
            return NS_OK;
          else
          {
     =>     mBridgeStream = bridge_create_stream(mEmitter, this, aURI, newType, 
whattodo, aChannel);
                        if (!mBridgeStream)
                          return NS_ERROR_OUT_OF_MEMORY;
                        else
                nsStreamConverter::AsyncConvertData(WORD const*,WORD 
const*,nsIStreamListener *,nsISupports *) [nsStreamConverter.cpp:1117]
                    
                        nsCOMPtr<nsIURI> aUri;
                        aChannel->GetURI(getter_AddRefs(aUri));
                 =>     return Init(aUri, aListener, aChannel);
                    }
                    
                    NS_IMETHODIMP nsStreamConverter::FirePendingStartRequest()
                nsMsgDraft::ProcessDraftOrTemplateOperation(char 
const*,int,nsIMsgIdentity *,nsIMsgDBHdr * *,nsIMsgWindow *) 
[nsMsgCreate.cpp:178]
                    
                      nsCOMPtr<nsIChannel> dummyChannel;
                      rv = 
NS_NewInputStreamChannel(getter_AddRefs(dummyChannel), aURL, nsnull, nsnull, 
-1);
                 =>   if (NS_FAILED(mimeParser->AsyncConvertData(nsnull, nsnull, 
nsnull, dummyChannel)))
                      {
                        Release();
                        mMessageService = nsnull;
                nsMsgDraft::OpenDraftMsg(char const*,nsIMsgDBHdr * 
*,nsIMsgIdentity *,int,nsIMsgWindow *) [nsMsgCreate.cpp:216]
                    
                      mAddInlineHeaders = addInlineHeaders;
                      return ProcessDraftOrTemplateOperation(msgURI, 
nsMimeOutput::nsMimeMessageDraftOrTemplate,
                 =>                                          identity, 
aMsgToReplace, aMsgWindow);
                    }
                    
                    nsresult
                nsMsgComposeService::OpenComposeWindow(char const*,char 
const*,int,int,nsIMsgIdentity *,nsIMsgWindow *) [nsMsgComposeService.cpp:276]
                          switch(type)
                          {
                            case nsIMsgCompType::ForwardInline:
                 =>             rv = pMsgDraft->OpenDraftMsg(uriToOpen.get(), 
nsnull, identity, PR_TRUE, aMsgWindow);
                              break;
                            case nsIMsgCompType::Draft:
                                rv = pMsgDraft->OpenDraftMsg(uriToOpen.get(), 
nsnull, identity, PR_FALSE, aMsgWindow);
(Reporter)

Comment 1

17 years ago
reassigning and cc'ing for reviews for upcoming patch
Assignee: ducarroz → naving
Keywords: mlk
QA Contact: esther → stephend
(Reporter)

Comment 2

17 years ago
Created attachment 59490 [details] [diff] [review]
proposed fix

options->url is const char* and never owns the buffer, it seems to always point

to mdd->url_name and I have tested it works.
(Reporter)

Comment 3

17 years ago
for example from mimemoz2.cpp:1497 

>  msd->options->url = msd->url_name;





Comment 4

17 years ago
you should run under purify. The owner of the string could free it out from
under you.
Comment on attachment 59490 [details] [diff] [review]
proposed fix

You cannot do that, unless you find a new fix for bug 31207. I know that sound
uggly.
Attachment #59490 - Flags: needs-work+

Updated

17 years ago
Status: NEW → ASSIGNED
mass re-assign.
Assignee: naving → sspitzer
Status: ASSIGNED → NEW
Product: MailNews → Core
sorry for the spam.  making bugzilla reflect reality as I'm not working on these bugs.  filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
Filter on "Nobody_NScomTLD_20080620"
QA Contact: stephend → mime
(Assignee)

Updated

10 years ago
Product: Core → MailNews Core

Updated

9 years ago
Severity: normal → minor

Updated

7 years ago
Blocks: 110171
You need to log in before you can comment on or make changes to this bug.