Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix some leaks and errors in sip conversions
  • Loading branch information
nyalldawson committed Jan 28, 2018
1 parent ebb725e commit f9a8161
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python/core/conversions.sip
Expand Up @@ -1799,6 +1799,8 @@ template<int, TYPE2*>
return NULL;
}

Py_DECREF(valueobj);
Py_DECREF(keyobj);
}

return d;
Expand Down Expand Up @@ -1997,9 +1999,7 @@ template <TYPE>
{
Py_DECREF(l);

if (tobj)
Py_DECREF(tobj);
else
if (!tobj)
delete t;

return NULL;
Expand Down Expand Up @@ -2073,8 +2073,6 @@ template <TYPE>

PyObject *keyobj = PyLong_FromLong(it.key());
PyObject *pyOobj = sipConvertFromType(oobj, sipType_QgsFeature, sipTransferObj);
PyDict_SetItem(d, keyobj, pyOobj);

if(pyOobj == NULL || keyobj == NULL || PyDict_SetItem(d, keyobj, pyOobj) < 0)
{
Py_DECREF(d);
Expand All @@ -2083,6 +2081,10 @@ template <TYPE>
{
Py_DECREF(pyOobj);
}
else
{
delete oobj;
}

if (keyobj)
{
Expand Down

0 comments on commit f9a8161

Please sign in to comment.