Skip to content

Commit 464a707

Browse files
committed
Fixed mem leak for attrs of objs or elements of collections that are themselves objects
1 parent 8bdf4c2 commit 464a707

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
- Fixed a compatibility regression affecting SODA "get" operations using older
2424
Oracle Client releases.
2525

26+
- Fixed a memory leak getting attributes of objects or elements of collections
27+
that are themselves objects.
28+
2629
## node-oracledb v5.0.0 (29 Jun 2020)
2730

2831
- Stated compatibility is now for Node.js 10.16+, 12 and 14.

src/njsDbObject.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ static bool njsDbObject_transformFromOracle(njsDbObject *obj, napi_env env,
766766
{
767767
napi_value global, constructor, temp;
768768
njsLobBuffer lobBuffer;
769+
bool ok;
769770

770771
// handle null values
771772
if (data->isNull) {
@@ -838,8 +839,10 @@ static bool njsDbObject_transformFromOracle(njsDbObject *obj, napi_env env,
838839
return njsUtils_throwErrorDPI(env, obj->type->oracleDb);
839840
return true;
840841
case DPI_ORACLE_TYPE_OBJECT:
841-
return njsDbObject_new(typeInfo->objectType, data->value.asObject,
842+
ok = njsDbObject_new(typeInfo->objectType, data->value.asObject,
842843
env, value);
844+
dpiObject_release(data->value.asObject);
845+
return ok;
843846
case DPI_ORACLE_TYPE_BOOLEAN:
844847
NJS_CHECK_NAPI(env, napi_get_boolean(env, data->value.asBoolean,
845848
value))

0 commit comments

Comments
 (0)