Closed
Bug 66438
Opened 25 years ago
Closed 25 years ago
status string leaked during composition
Categories
(MailNews Core :: Composition, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.8
People
(Reporter: dbaron, Assigned: bugzilla)
Details
(Keywords: memory-leak)
Attachments
(1 file)
|
1.44 KB,
patch
|
Details | Diff | Splinter Review |
While writing a message from a mailto: link, the Boehm GC said the a string
was leaked allocated from:
PR_Malloc
nsMemoryImpl::Alloc(unsigned int)
nsMemory::Alloc(unsigned int)
nsCppSharedAllocator::allocate(unsigned int, void const *)
nsCRT::strndup(unsigned wchar_t const *, unsigned int)
nsCRT::strdup(unsigned wchar_t const *)
nsMsgComposeAndSend::SetStatusMessage(unsigned wchar_t const *)
nsMsgComposeAndSend::Init(nsIMsgIdentity *, nsMsgCompFields *, nsFileSpec *,
int, int, int, nsIMessage *, char const *, char const *, unsigned int,
nsMsgAttachmentData const *, nsMsgAttachedFile const *)
nsMsgComposeAndSend::CreateAndSendMessage(nsIEditorShell *, nsIMsgIdentity *,
nsIMsgCompFields *, int, int, int, nsIMessage *, char const *, char const *,
unsigned int, nsMsgAttachmentData const *, nsMsgAttachedFile const *, void *,
nsIMsgSendListener **, unsigned int)
nsMsgCompose::_SendMsg(int, nsIMsgIdentity *, int)
nsMsgCompose::SendMsg(int, nsIMsgIdentity *)
XPTC_InvokeByIndex
It looks like the problem is that nsMsgComposeAndSend::SetStatusMessage does an
unnecessary strdup and never frees the result. AFAICT, that stdrup should just
be removed and you should use aMsgString directly.
Also, while I'm here, I'll point out that nsMsgStatusFeedback::ShowStatusString
is also inefficient: the nsAutoString is unnecessary and could be removed (it's
never used).
Comment 1•25 years ago
|
||
Comment 2•25 years ago
|
||
The above patch fixes the leak in nsMsgComposeAndSend::SetStatusMessage and
removes the unused nsAutoString in nsMsgStatusFeedback::ShowStatusString (as per
dbaron's comments). Can someone look at this for an r/sr=?
| Reporter | ||
Updated•25 years ago
|
| Assignee | ||
Comment 3•25 years ago
|
||
Right thing to do. R=ducarroz. Please send an email to reviewers@mozilla.org and
mscott@netscape.com for a super review. Good job. Once you get the SR, I'll
check in the patch for you.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.8
Comment 4•25 years ago
|
||
sr=mscott. thanks for the code contribution!
| Assignee | ||
Comment 5•25 years ago
|
||
Fixed and checked in. Thanks Kevin Higgins.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
QA Contact: esther → stephend
verified fixed.
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: MailNews → Core
Updated•18 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•