Closed
Bug 116422
Opened 24 years ago
Closed 24 years ago
MLK: Memory leak of 22 bytes from 1 block allocated in PR_Malloc
Categories
(MailNews Core :: Networking: NNTP, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: naving, Assigned: naving)
Details
(Keywords: memory-leak)
Attachments
(1 file, 1 obsolete file)
|
1.26 KB,
patch
|
sspitzer
:
superreview+
|
Details | Diff | Splinter Review |
Cancelling a news message leaks here....
Distribution of leaked blocks
Allocation location
malloc [dbgheap.c:129]
PR_Malloc [prmem.c:54]
msg_extract_Header_address_mailboxes [nsMsgHeaderParser.cpp:1027]
size += j + 2;
}
=> result = (char*)PR_Malloc(size + 1);
if (!result)
{
PR_Free(addrs);
nsMsgHeaderParser::ExtractHeaderAddressMailboxes(char
const*,char const*,char * *) [nsMsgHeaderParser.cpp:205]
(void) NS_ConvertUTF8toUCS2(line).get(); // asserts if
invalid UTF-8
#endif
=> *mailboxes = msg_extract_Header_address_mailboxes(line);
return NS_OK;
}
else
nsNNTPProtocol::CheckIfAuthor(nsISupports *,void *)
[nsNNTPProtocol.cpp:4248]
char *us = nsnull;
char *them = nsnull;
=> nsresult rv1 =
parser->ExtractHeaderAddressMailboxes(nsnull, cancelInfo->from, &us);
nsresult rv2 =
parser->ExtractHeaderAddressMailboxes(nsnull, cancelInfo->old_from, &them);
PR_LOG(NNTP,PR_LOG_ALWAYS,("us = %s, them = %s", us,
them));
nsSupportsArray::EnumerateForwards((*)(nsISupports *,void
*),void *) [nsSupportsArray.cpp:684]
PRBool running = PR_TRUE;
while (running && (++aIndex < (PRInt32)mCount)) {
=> running = (*aFunc)(mArray[aIndex], aData);
}
return running;
}
nsNNTPProtocol::DoCancel(void) [nsNNTPProtocol.cpp:4361]
if (NS_FAILED(rv)) return -1;
// CheckIfAuthor will set cancelInfo.from if a
match is found
=> identities->EnumerateForwards(CheckIfAuthor, (void
*)&cancelInfo);
}
if (!cancelInfo.from) {
nsNNTPProtocol::ProcessProtocolState(nsIURI *,nsIInputStream
*,UINT,UINT) [nsNNTPProtocol.cpp:5267]
nsMsgProtocol::OnDataAvailable(nsIRequest *,nsISupports
*,nsIInputStream *,UINT,UINT) [nsMsgProtocol.cpp:262]
nsOnDataAvailableEvent::HandleEvent(void)
[nsStreamListenerProxy.cpp:193]
| Assignee | ||
Updated•24 years ago
|
Keywords: mlk
Summary: [W] MLK: Memory leak of 22 bytes from 1 block allocated in PR_Malloc → MLK: Memory leak of 22 bytes from 1 block allocated in PR_Malloc
| Assignee | ||
Comment 1•24 years ago
|
||
free 'us' and 'them'.
| Assignee | ||
Comment 2•24 years ago
|
||
use nsXPIDLCString for 'us' and 'them'
Attachment #62566 -
Attachment is obsolete: true
Comment 3•24 years ago
|
||
Comment on attachment 62568 [details] [diff] [review]
proposed fix
sr=sspitzer
does the PR_LOG() still do the right thing?
Attachment #62568 -
Flags: superreview+
| Assignee | ||
Comment 4•24 years ago
|
||
fixed PR_LOG as well
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Nice work, thanks for filing/fixing this.
Verified FIXED using Windows 2000, latest trunk build as of 2:30 pm 12-31-2001,
running Purify.
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: MailNews → Core
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•