Closed Bug 586650 Opened 14 years ago Closed 14 years ago

txFnStartOutput leaks qname when qname->init fails

Categories

(Core :: XSLT, defect)

x86
macOS
defect
Not set
normal

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);
Attached patch patch (obsolete) (deleted) — Splinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #465235 - Flags: review?(jonas)
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+
Attached patch autoptr (deleted) — Splinter Review
Attachment #465235 - Attachment is obsolete: true
Attachment #465340 - Flags: review+
Attachment #465340 - Flags: approval2.0?
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: