File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ Version 8.2 (TBD)
1111#) Updated embedded ODPI-C to `version 4.2.0
1212 <https://oracle.github.io/odpi/doc/releasenotes.html#
1313 version-4-2-tbd> `__.
14+ #) Eliminated memory leak when calling :meth: `SodaOperation.filter() ` with a
15+ dictionary.
1416
1517
1618Version 8.1 (December 2020)
Original file line number Diff line number Diff line change 11//-----------------------------------------------------------------------------
2- // Copyright (c) 2018, 2020 , Oracle and/or its affiliates. All rights reserved.
2+ // Copyright (c) 2018, 2021 , Oracle and/or its affiliates. All rights reserved.
33//-----------------------------------------------------------------------------
44
55//-----------------------------------------------------------------------------
@@ -109,16 +109,20 @@ static PyObject *cxoSodaOperation_repr(cxoSodaOperation *op)
109109static PyObject * cxoSodaOperation_filter (cxoSodaOperation * op ,
110110 PyObject * filterObj )
111111{
112+ PyObject * convertedFilterObj = NULL ;
113+
112114 cxoBuffer_clear (& op -> filterBuffer );
113115 if (PyDict_Check (filterObj )) {
114- filterObj = PyObject_CallFunctionObjArgs (cxoJsonDumpFunction ,
116+ convertedFilterObj = PyObject_CallFunctionObjArgs (cxoJsonDumpFunction ,
115117 filterObj , NULL );
116- if (!filterObj )
118+ if (!convertedFilterObj )
117119 return NULL ;
120+ filterObj = convertedFilterObj ;
118121 }
119122 if (cxoBuffer_fromObject (& op -> filterBuffer , filterObj ,
120123 op -> coll -> db -> connection -> encodingInfo .encoding ) < 0 )
121124 return NULL ;
125+ Py_CLEAR (convertedFilterObj );
122126 op -> options .filter = op -> filterBuffer .ptr ;
123127 op -> options .filterLength = op -> filterBuffer .size ;
124128 Py_INCREF (op );
You can’t perform that action at this time.
0 commit comments