Closed Bug 112287 Opened 23 years ago Closed 23 years ago

MLK: leaking url in mime when forwarding inline

Categories

(MailNews Core :: MIME, defect)

x86
Windows NT
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: naving, Assigned: naving)

Details

(Keywords: memory-leak)

Attachments

(1 file)

[W] MLK: Memory leak of 164 bytes from 1 block allocated in nsStandardURLConstructor Distribution of leaked blocks Allocation location new(UINT) [new.cpp:23] nsStandardURLConstructor [nsNetModule.cpp:134] nsGenericFactory::CreateInstance(nsISupports *,nsID const&,void * *) [nsGenericFactory.cpp:74] nsComponentManagerImpl::CreateInstance(nsID const&,nsISupports *,nsID const&,void * *) [nsComponentManager.cpp:1559] nsComponentManager::CreateInstance(nsID const&,nsISupports *,nsID const&,void * *) [nsComponentManager.cpp:3330] nsFileProtocolHandler::NewURI(char const*,nsIURI *,nsIURI * *) [nsFileProtocolHandler.cpp:134] nsIOService::NewURI(char const*,nsIURI *,nsIURI * *) [nsIOService.cpp:745] } if (NS_FAILED(rv)) return rv; => return handler->NewURI(aSpec, base, result); } nsMimeNewURI [mimemoz2.cpp:631] if (NS_FAILED(res)) return NS_ERROR_FACTORY_NOT_REGISTERED; => return pService->NewURI(aSpec, aBase, aInstancePtrResult); } extern "C" nsresult mime_decompose_file_init_fn(void *,MimeHeaders *) [mimedrft.cpp:1850] if (tmpSpec) { nsFileURL fileURL(*tmpSpec); => const char * tempSpecStr = fileURL.GetURLString(); nsMimeNewURI(&(newAttachment->orig_url), tempSpecStr, nsnull); NS_IF_ADDREF(newAttachment->orig_url); MimeMessage_add_child [mimemsg.cpp:603] int status = 0; status = parent->options->decompose_file_init_fn ( parent->options->stream_closure, => ((MimeMessage*)parent)->hdrs ); if ( status < 0 ) return status; } #endif /* MIME_DRAFTS */
QA Contact: esther → stephend
Summary: leaking url in mime when forwarding inline → MLK: leaking url in mime when forwarding inline
Attached patch proposed fixSplinter Review
use nsCOMPtr to avoid explicit addref and release. here it is being addref'ed twice.
cc ducarroz and bienvenu for review
Attachment #59446 - Flags: superreview+
Comment on attachment 59446 [details] [diff] [review] proposed fix + if (a[i].orig_url) + a[i].orig_url=nsnull; should just be a[i].orig_url=nsnull, no need to check if it's null before. Also, it seems like there might be tabs in your diff. Fix those things, and sr=bienvenu
Comment on attachment 59446 [details] [diff] [review] proposed fix don't need to test orig_url before setting it to null (3 occurrences). Appart that, R=ducarroz
Attachment #59446 - Flags: review+
fixed
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified FIXED using the latest trunk build on Windows 2000 / Purify.
Status: RESOLVED → VERIFIED
Keywords: mlk
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

Creator:
Created:
Updated:
Size: