Skip to content
Permalink
Browse files

Fix some leaks and errors in sip conversions

  • Loading branch information
nyalldawson committed Jan 28, 2018
1 parent ebb725e commit f9a81617335bf1a9a019e37ab8a1a28e63e0f2cc
Showing with 7 additions and 5 deletions.
  1. +7 −5 python/core/conversions.sip
@@ -1799,6 +1799,8 @@ template<int, TYPE2*>
return NULL;
}

Py_DECREF(valueobj);
Py_DECREF(keyobj);
}

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

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

return NULL;
@@ -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);
@@ -2083,6 +2081,10 @@ template <TYPE>
{
Py_DECREF(pyOobj);
}
else
{
delete oobj;
}

if (keyobj)
{

0 comments on commit f9a8161

Please sign in to comment.
You can’t perform that action at this time.