Closed Bug 138081 Opened 22 years ago Closed 22 years ago

nsDataChannel::ParseData leaks on various failures

Categories

(Core :: Networking, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.1alpha

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file)

dataToWrite is leaked on all those wonderful |if (NS_FAILED(rv)) return rv;|
blocks that come after it has been allocated.  If we're dealing with non-text
data, dataBuffer is leaked as well.
Attached patch Patch v1.0Splinter Review
to me
Assignee: new-network-bugs → bzbarsky
Priority: -- → P1
Target Milestone: --- → mozilla1.1alpha
Attachment #79735 - Flags: review+
Comment on attachment 79735 [details] [diff] [review]
Patch v1.0

Index: protocol/data/src/nsDataChannel.cpp

>@@ -204,12 +211,18 @@

>+        // XXX PL_Base64Decode will return a null pointer for decoding
>+        // errors.  Since those are more likely than out-of-memory,
>+        // should we return NS_ERROR_MALFORMED_URI instead?

how about NS_ERROR_UNEXPECTED?

nice work! sr=darin
Attachment #79735 - Flags: superreview+
Checked in on trunk, with NS_ERROR_UNEXPECTED as the error.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
This does not build on Windows, apparently.  I backed it out and will work on a
different fix.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
OK, this builds on windows if I move the      

PRUint32 dataLen = PL_strlen(dataBuffer);

line to before the goto that's above it.  So I'll be relanding this with that
change...
relanded
Status: REOPENED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
Verified per bzbarsky's comments.
Status: RESOLVED → VERIFIED
QA Contact: benc → junruh
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: