Closed
Bug 586650
Opened 14 years ago
Closed 14 years ago
txFnStartOutput leaks qname when qname->init fails
Categories
(Core :: XSLT, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: timeless)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, memory-leak)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
timeless
:
review+
sicking
:
approval2.0+
|
Details | Diff | Splinter Review |
txExpandedName* qname = new txExpandedName();
NS_ENSURE_TRUE(qname, NS_ERROR_OUT_OF_MEMORY);
rv = qname->init(tokens.nextToken(),
aState.mElementContext->mMappings, PR_FALSE);
leaks qname:
NS_ENSURE_SUCCESS(rv, rv);
rv = item->mFormat.mCDATASectionElements.add(qname);
leaks qname:
NS_ENSURE_SUCCESS(rv, rv);
Comment on attachment 465235 [details] [diff] [review]
patch
Please use
nsAutoPtr<...> qname = new ...;
....
rv = item->mFormat.mCDATASectionElements.add(qname);
NS_ENSURE_SUCCESS(rv, rv);
qname.forget();
to keep the code more readable. r=me with that change. Also, in the future, please include more context in your patches. -u8 is a pretty good number.
Attachment #465235 -
Flags: review?(jonas) → review+
Attachment #465235 -
Attachment is obsolete: true
Attachment #465340 -
Flags: review+
Attachment #465340 -
Flags: approval2.0?
Attachment #465340 -
Flags: approval2.0? → approval2.0+
Keywords: checkin-needed
Comment 4•14 years ago
|
||
Updated•6 years ago
|
Blocks: coverity-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•