Closed
Bug 28064
Opened 25 years ago
Closed 25 years ago
nsHTTPRequest memory leak
Categories
(Core :: Networking, defect, P3)
Tracking
()
VERIFIED
FIXED
M15
People
(Reporter: jrohlf, Assigned: gagan)
Details
(Keywords: memory-leak)
In M13 nsHTTPRequest::WriteRequest():
fieldName is never deleted. I suspect it should be a
nsXPIDLCString.
while (bMoreHeaders) {
enumerator->GetNext(getter_AddRefs(item));
header = do_QueryInterface(item);
NS_ASSERTION(header, "Bad HTTP header.");
if (header) {
header->GetField(getter_AddRefs(headerAtom));
char* fieldName = nsnull;
header->GetFieldName(&fieldName);
NS_ASSERTION(fieldName, "field name not returned!, \
out of memory?");
//if (!fieldName)
//return NS_ERROR_OUT_OF_MEMORY;
mRequestBuffer.Append(fieldName);
header->GetValue(getter_Copies(autoBuffer));
mRequestBuffer.Append(": ");
mRequestBuffer.Append(autoBuffer);
mRequestBuffer.Append(CRLF);
}
enumerator->HasMoreElements(&bMoreHeaders);
}
Updated•25 years ago
|
Target Milestone: M15
Hmm.... not sure which version of this file you are looking at but there is a
nsCRT::free(fieldName) at the bottom of the scope and no returns before that...
Anyway I have made that an nsXPIDLCString to be consistent.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•