Closed Bug 898675 Opened 7 years ago Closed 7 years ago

[binary data] FieldList is not freed on error in StructType::layout

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: nsm, Assigned: nsm)

References

Details

Attachments

(1 file)

errors in layout (places where layout() returns false) should free the FieldList that is allocated.
Comment on attachment 782270 [details] [diff] [review]
Binary Data: Free StructType fieldList on error.

Review of attachment 782270 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/builtin/BinaryData.cpp
@@ +1528,4 @@
>  
>          RootedObject fieldType(cx, fieldTypeVal.toObjectOrNull());
>          if (!IsBinaryType(fieldType))
> +            goto error;

I think we should report some sort of error here.
Attachment #782270 - Flags: review?(nmatsakis) → review+
The error is reported by StructType::create(), should it be more specific? Landing for now.

https://hg.mozilla.org/integration/mozilla-inbound/rev/0da6dd571263
Ah, I see. Usually the convention as I understand it is that if a function takes a JSContext *cx, it will ensure that an error is reported if it returns an error. Maybe just add a comment.
https://hg.mozilla.org/mozilla-central/rev/0da6dd571263
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.