Closed Bug 112343 Opened 24 years ago Closed 24 years ago

Memory leak of 5 bytes from 1 block allocated in BuildAttachmentList

Categories

(MailNews Core :: MIME, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.8

People

(Reporter: stephend, Assigned: bugzilla)

Details

(Keywords: memory-leak, Whiteboard: Have fix)

Attachments

(2 files, 1 obsolete file)

Build: Latest trunk pull @8:45 pm using Windows 2000 / Purify. Summary: Memory leak of 5 bytes from 1 block allocated in BuildAttachmentList Steps to Reproduce: See my test post at news://news.mcom.com/netscape.public.test entitled, "Testing leaks, ignore this". [W] MLK: Memory leak of 5 bytes from 1 block allocated in PR_Malloc Distribution of leaked blocks 5 bytes from 1 block of 5 bytes (0x09824b70) Allocation location malloc [msvcrt.DLL] PR_Malloc [prmem.c:50] BuildAttachmentList(MimeObject *,nsMsgAttachmentData *,char const*,int) [mimemoz2.cpp:469] tmp->real_name = MimeGetStringByID(MIME_MSG_DEFAULT_ATTACHMENT_NAME); if (tmp->real_name) { => char *newName = PR_smprintf(tmp->real_name, mime_part_address (child)); if (newName) { PR_Free(tmp->real_name); MimeGetAttachmentList [mimemoz2.cpp:530] nsCRT::memset(*data, 0, (n + 1) * sizeof(nsMsgAttachmentData)); // Now, build the list! => return BuildAttachmentList((MimeObject *) cobj, *data, aMessageURL, PR_FALSE); } extern "C" void mime_display_stream_complete [mimemoz2.cpp:900] extern void mime_dump_attachments ( nsMsgAttachmentData *attachData ); nsMsgAttachmentData *attachments; => nsresult rv = MimeGetAttachmentList(obj, msd->url_name, &attachments); if (NS_SUCCEEDED(rv)) { NotifyEmittersOfAttachmentList(msd->options, attachments); nsStreamConverter::OnStopRequest(nsIRequest *,nsISupports *,UINT) [nsStreamConverter.cpp:1027] mMimeStreamConverterListener = nsnull; // release our reference } => tSession->complete((nsMIMESession *)mBridgeStream); } // nsDocumentOpenInfo::OnStopRequest(nsIRequest *,nsISupports *,UINT) [nsURILoader.cpp:252] nsCOMPtr<nsIStreamListener> listener(m_targetStreamListener); m_targetStreamListener = 0; => listener->OnStopRequest(request, aCtxt, aStatus); } // Remember... nsNntpCacheStreamListener::OnStopRequest(nsIRequest *,nsISupports *,UINT) [nsNNTPProtocol.cpp:723] nsNntpCacheStreamListener::OnStopRequest(nsIRequest *request, nsISupports * aCtxt, nsresult aStatus) { nsCOMPtr <nsIRequest> ourRequest = do_QueryInterface(mChannelToUse); => nsresult rv = mListener->OnStopRequest(ourRequest, aCtxt, aStatus); nsCOMPtr <nsILoadGroup> loadGroup; mChannelToUse->GetLoadGroup(getter_AddRefs(loadGroup)); if (loadGroup) nsStorageTransport::nsReadRequest::Process(void) [nsStorageTransport.cpp:500] mTransport->ReadRequestCompleted(this); // no need to proxy this callback => (void) mListener->OnStopRequest(this, mListenerContext, mStatus); //OnStopRequest completed and listeners no longer needed. mListener=nsnull; nsStorageTransport::nsReadRequest::OnDataAvailable(nsIRequest *,nsISupports *,nsIInputStream *,UINT,UINT) [nsStorageTransport.cpp:639] } // post the next message... => return Process(); } NS_IMETHODIMP XPTC_InvokeByIndex [xptcinvoke.cpp:152] EventHandler [nsProxyEvent.cpp:514] md_EventReceiverProc [plevent.c:1071] ScrollDC [user32.dll] ScrollDC [user32.dll] DispatchMessageA [user32.dll] DispatchMessageA [USER32.DLL] nsAppShell::Run(void) [nsAppShell.cpp:121] nsAppShellService::Run(void) [nsAppShellService.cpp:301] main1 [nsAppRunner.cpp:1302]
Keywords: mlk
QA Contact: esther → stephend
I don't hit this code on reading this news message.
I don't see this leak, using the attached message! Stephen, can you test again please. Thanks
Status: NEW → ASSIGNED
Attached patch Proposed fix, v1 (obsolete) — Splinter Review
Whiteboard: Have fix
Target Milestone: --- → mozilla0.9.8
Comment on attachment 61499 [details] [diff] [review] Proposed fix, v1 r=varada
Attachment #61499 - Flags: review+
both "part" variables aren't in the same scope, are they? if so, can you rename the second one to something else? if not, sr=sspitzer
Attached patch Proposed fix, v2Splinter Review
Seth was right, both part were declared in the same function and where representing exactly the same information. I've fixed that by using nsXPIDLCString instead, same for imappart. That cause me change couple function to take const char * instead of char *
Attachment #61499 - Attachment is obsolete: true
Keywords: patch, review
Comment on attachment 62379 [details] [diff] [review] Proposed fix, v2 sr=sspitzer
Attachment #62379 - Flags: superreview+
Comment on attachment 62379 [details] [diff] [review] Proposed fix, v2 r=cavin
Attachment #62379 - Flags: review+
Fixed and checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
I don't see this anymore, marking verified fixed. Note that I've filed a couple new MIME/.vcf bugs, bug 117563 and bug 117565. Latest trunk, Windows 2000 using Purify.
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.

Attachment

General

Created:
Updated:
Size: