diff options
author | Matt Cotter <matt.cotter@mongodb.com> | 2016-05-04 14:54:36 -0400 |
---|---|---|
committer | Matt Cotter <matt.cotter@mongodb.com> | 2016-05-04 16:26:32 -0400 |
commit | 47fc89f86339b2fc4327eec485ff04030ee02173 (patch) | |
tree | 1a8dc7acd82b1e6be5c27affc39475f2dba1bb6d /src | |
parent | 29ff4c8033c8c22cf212e13bd27be05649c03f3e (diff) | |
download | mongo-47fc89f86339b2fc4327eec485ff04030ee02173.tar.gz |
SERVER-24051 fix leak in NumberDecimalInfo::make
This previously called the constructor
(NumberDecimalInfo::construct) and then created a new pointer and
stored that. The underlying value from the constructor was leaked.
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/scripting/mozjs/numberdecimal.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/scripting/mozjs/numberdecimal.cpp b/src/mongo/scripting/mozjs/numberdecimal.cpp index a845b3bb99d..e5243eb6c8e 100644 --- a/src/mongo/scripting/mozjs/numberdecimal.cpp +++ b/src/mongo/scripting/mozjs/numberdecimal.cpp @@ -101,7 +101,7 @@ void NumberDecimalInfo::construct(JSContext* cx, JS::CallArgs args) { void NumberDecimalInfo::make(JSContext* cx, JS::MutableHandleValue thisv, Decimal128 decimal) { auto scope = getScope(cx); - scope->getProto<NumberDecimalInfo>().newInstance(thisv); + scope->getProto<NumberDecimalInfo>().newObject(thisv); JS_SetPrivate(thisv.toObjectOrNull(), new Decimal128(decimal)); } |