Closed
Bug 118884
Opened 23 years ago
Closed 23 years ago
Memory leak of 268 bytes from 1 block allocated in nsSimpleCharString::ReallocData
Categories
(Core :: XPCOM, defect)
Tracking
()
VERIFIED
WORKSFORME
mozilla1.2alpha
People
(Reporter: stephend, Assigned: bugzilla)
Details
(Keywords: memory-leak)
Attachments
(1 file)
773 bytes,
text/plain
|
Details |
Sorry, I'm not sure this is the correct component...
Build ID: Latest trunk CVS pull on Windows 2000 under Purify.
Summary: Memory leak of 268 bytes from 1 block allocated in
nsSimpleCharString::ReallocData
Steps to Reproduce:
1. Launch mozilla -mail.
2. Click on a Draft message.
3. Click "Edit Draft".
4. Close the window, choose, "Don't Save".
5. Close the 3 pane window.
[W] MLK: Memory leak of 268 bytes from 1 block allocated in PR_Malloc
Distribution of leaked blocks
Allocation location
malloc [MSVCRT.DLL]
PR_Malloc [prmem.c:402]
nsSimpleCharString::ReallocData(UINT) [nsFileSpec.cpp:277]
PRUint32 copyLength = Length();
if (inLength < copyLength)
copyLength = inLength;
=> Data* newData = (Data*)PR_Malloc(newAllocLength + sizeof(Data));
// If data was already allocated when we get to here, then we are
cloning the data
// from a shared pointer.
if (mData)
nsSimpleCharString::CopyFrom(char const*,UINT) [nsFileSpec.cpp:194]
{
if (!inData)
return;
=> ReallocData(inLength);
if (!mData)
return;
if (inLength != 0) {
??? [ip=0x0013f338]
nsSimpleCharString::=(char const*) [nsFileSpec.cpp:126]
//----------------------------------------------------------------------------------------
{
if (inString)
=> CopyFrom(inString, nsCRT::strlen(inString));
else
SetToEmpty();
} // nsSimpleCharString::operator =
??? [ip=0x0013f4c4]
nsFileSpec::=(char const*) [nsFileSpec.cpp:1029]
void nsFileSpec::operator = (const char* inString)
//----------------------------------------------------------------------------------------
{
=> mPath = inString;
// Make canonical and absolute.
nsFileSpecHelpers::Canonify(mPath, PR_FALSE /* XXX? */);
mError = NS_OK;
nsSpecialSystemDirectory::=(SystemDirectories::nsSpecialSystemDirectory)
[nsSpecialSystemDirectory.cpp:648]
systemDirectoriesLocations->Get(&dirKey);
}
if (dirSpec) {
=> *this = *dirSpec;
}
else {
GetCurrentProcessDirectory(*this);
nsSpecialSystemDirectory::nsSpecialSystemDirectory(SystemDirectories::nsSpecialSystemDirectory)
[nsSpecialSystemDirectory.cpp:451]
//----------------------------------------------------------------------------------------
: nsFileSpec(nsnull)
{
=> *this = aSystemSystemDirectory;
}
//----------------------------------------------------------------------------------------
??? [ip=0x090ce090]
nsMsgCreateTempFileSpec(char const*) [mimedrft.cpp:152]
*tmpSpec += tempName.get();
tmpSpec->MakeUnique();
=> return tmpSpec;
}
////////////////////////////////////////////////////////////////////////////////////
mime_decompose_file_init_fn(void *,MimeHeaders *) [mimedrft.cpp:1818]
newAttachName.Append(".tmp");
}
=> tmpSpec = nsMsgCreateTempFileSpec(NS_CONST_CAST(char*,
newAttachName.get()));
}
// This needs to be done so the attachment structure has a handle
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 */
??? [ip=0x090bf4c0]
MimeMessage_close_headers [mimemsg.cpp:442]
PR_FREEIF(ct);
if (!body) return MIME_OUT_OF_MEMORY;
=> status = ((MimeContainerClass *) obj->clazz)->add_child (obj, body);
if (status < 0)
{
mime_free(body);
MimeMessage_parse_line [mimemsg.cpp:271]
convert_and_send_buffer [mimebuf.cpp:168]
}
#endif
=> return (*per_line_fn)(buf, length, closure);
}
extern "C" int
mime_LineBuffer [mimebuf.cpp:255]
status = convert_and_send_buffer(*bufferP, *buffer_fpP,
convert_newlines_p,
=> per_line_fn, closure);
if (status < 0)
return status;
MimeObject_parse_buffer [mimeobj.cpp:255]
((int (*PR_CALLBACK) (char *, PRInt32, void *))
/* This cast is to turn void into MimeObject */
obj->clazz->parse_line),
=> obj);
Reporter | ||
Updated•23 years ago
|
Reporter | ||
Comment 1•23 years ago
|
||
The nsFileSpecImpl allocated by
tmpSpec = nsMsgCreateTempFileSpec(fileName)
in mime_decompose_file_init_fn(...) is leaking.
Here is the stack trace.
mime_decompose_file_init_fn(void * 0x04eca690, MimeHeaders * 0x04f3d980) line
1866
MimeMessage_add_child(MimeObject * 0x04ecb100, MimeObject * 0x04f3d610) line 603
+ 29 bytes
MimeMessage_close_headers(MimeObject * 0x04ecb100) line 442 + 16 bytes
MimeMessage_parse_line(char * 0x048f8da8, int 2, MimeObject * 0x04ecb100) line
271 + 9 bytes
convert_and_send_buffer(char * 0x048f8da8, int 2, int 1, int (char *, unsigned
int, void *)* 0x04487780 MimeMessage_parse_line(char *, int, MimeObject *), void
* 0x04ecb100) line 168 + 15 bytes
mime_LineBuffer(const char * 0x04f3cf36, int 107, char * * 0x04ecb128, int *
0x04ecb130, unsigned int * 0x04ecb138, int 1, int (char *, unsigned int, void
*)* 0x04487780 MimeMessage_parse_line(char *, int, MimeObject *), void *
0x04ecb100) line 255 + 29 bytes
MimeObject_parse_buffer(char * 0x04f3cd70, int 561, MimeObject * 0x04ecb100)
line 255 + 49 bytes
mime_parse_stream_write(_nsMIMESession * 0x04ecf4e0, const char * 0x04f3cd70,
int 561) line 454 + 26 bytes
nsStreamConverter::OnDataAvailable(nsStreamConverter * const 0x04ec8260,
nsIRequest * 0x04ecff90, nsISupports * 0x04ecbd44, nsIInputStream * 0x04f3b048,
unsigned int 0, unsigned int 561) line 902 + 24 bytes
nsImapCacheStreamListener::OnDataAvailable(nsImapCacheStreamListener * const
0x04f3d070, nsIRequest * 0x04f3b040, nsISupports * 0x04ecbd44, nsIInputStream *
0x04f3b048, unsigned int 0, unsigned int 561) line 6887 + 51 bytes
nsStorageTransport::nsReadRequest::OnDataAvailable(nsStorageTransport::nsReadReq
uest * const 0x04f3b044, nsIRequest * 0x04f3b040, nsISupports * 0x04ecbd44,
nsIInputStream * 0x04f3b048, unsigned int 0, unsigned int 561) line 625 + 46
bytes
XPTC_InvokeByIndex(nsISupports * 0x04f3b044, unsigned int 5, unsigned int 5,
nsXPTCVariant * 0x04f3b170) line 106
EventHandler(PLEvent * 0x04f3b120) line 515 + 41 bytes
PL_HandleEvent(PLEvent * 0x04f3b120) line 590 + 10 bytes
PL_ProcessPendingEvents(PLEventQueue * 0x00497e20) line 520 + 9 bytes
_md_EventReceiverProc(HWND__ * 0x00090a62, unsigned int 49636, unsigned int 0,
long 4816416) line 1071 + 9 bytes
USER32! 77e12e98()
USER32! 77e130e0()
USER32! 77e15824()
nsAppShellService::Run(nsAppShellService * const 0x004aba70) line 308
main1(int 1, char * * 0x00444be0, nsISupports * 0x00000000) line 1285 + 32 bytes
main(int 1, char * * 0x00444be0) line 1625 + 37 bytes
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 77e97d08()
Assignee: neeti → ducarroz
Status: ASSIGNED → NEW
Updated•23 years ago
|
Assignee | ||
Comment 4•23 years ago
|
||
tmpSpec get correctly deleted once the compose window loaded. WFM
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•