Closed Bug 306809 Opened 19 years ago Closed 19 years ago

oom mlk in txVariable::Convert

Categories

(Core :: XSLT, defect, P1)

x86
Windows XP
defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta4

People

(Reporter: timeless, Assigned: peterv)

References

()

Details

(Keywords: fixed1.8, memory-leak)

Attachments

(1 file)

first the easy mlk:
1108                                   txXPathNode *xpathNode =
1109                                       txXPathNativeNode::createXPathNode(node);
1110                                   if (!xpathNode) {
1111                                       return NS_ERROR_FAILURE;
1112 peterv   1.39                     }
1113               
1114                                   nodeSet->add(*xpathNode);
add returns nsresult (NS_ERROR_OUT_OF_MEMORY). you leak xpathNode;

this also happens near 1202.

i think there's a more fun crash case that could happen involving spidermonkey,
but i'm not sure about the rules for js dependent strings (if i'm right, you
could try to construct a dependentstring from a null pointer or a fmr length).
Attached patch v1Splinter Review
Attachment #194673 - Flags: superreview?(bzbarsky)
Attachment #194673 - Flags: review?(bzbarsky)
Comment on attachment 194673 [details] [diff] [review]
v1

I'm assuming add() just copies the data in the node and doesn't hold a ptr to
it, right?
Attachment #194673 - Flags: superreview?(bzbarsky)
Attachment #194673 - Flags: superreview+
Attachment #194673 - Flags: review?(bzbarsky)
Attachment #194673 - Flags: review+
Yes. We're going to clean up the whole txXPathNativeNode mess at some point so
that we won't run into these leaks anymore.
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.8beta4
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 194673 [details] [diff] [review]
v1

Trivial leak fix.
Attachment #194673 - Flags: approval1.8b4?
Attachment #194673 - Flags: approval1.8b4? → approval1.8b4+
Time is short for 1.8b4. If this isn't landed today, it's not going to make the
train.
peterv landed this on branch on the 4th.
Keywords: fixed1.8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: