Skip to content

Commit

Permalink
SERVER-25482 Coverity analysis defect 99830: Unchecked return value
Browse files Browse the repository at this point in the history
  • Loading branch information
WaleyChen committed Aug 8, 2016
1 parent 11394b9 commit 1257f4f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mongo/scripting/mozjs/objectwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,10 @@ ObjectWrapper::WriteFieldRecursionFrame::WriteFieldRecursionFrame(JSContext* cx,

if (isArray) {
uint32_t length;
JS_GetArrayLength(cx, thisv, &length);
if (!JS_GetArrayLength(cx, thisv, &length)) {
throwCurrentJSException(
cx, ErrorCodes::JSInterpreterFailure, "Failure to get array length");
}

if (!ids.reserve(length)) {
throwCurrentJSException(
Expand Down

0 comments on commit 1257f4f

Please sign in to comment.