bugfix: unpack_object_from_bv() and unpack_object_from_idb() were leaking objects

This commit is contained in:
elias.bachaalany 2010-04-23 10:51:49 +00:00
parent ecb4232040
commit 3e0343daf5

View File

@ -230,7 +230,9 @@ PyObject *py_unpack_object_from_idb(
// Conversion failed?
if ( err != CIP_OK )
return Py_BuildValue("(ii)", 0, err);
return Py_BuildValue("(iO)", 1, py_ret);
PyObject *py_result = Py_BuildValue("(iO)", 1, py_ret);
Py_DECREF(py_ret);
return py_result;
}
//-------------------------------------------------------------------------
@ -270,7 +272,9 @@ PyObject *py_unpack_object_from_bv(
// Conversion failed?
if ( err != CIP_OK )
return Py_BuildValue("(ii)", 0, err);
return Py_BuildValue("(iO)", 1, py_ret);
PyObject *py_result = Py_BuildValue("(iO)", 1, py_ret);
Py_DECREF(py_ret);
return py_result;
}
//-------------------------------------------------------------------------