mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-10 07:14:46 +03:00
Add Py_DECREF for each sequence returned by PySequence_Fast, so that these sequences are not leaked. Fixes #1187.
This commit is contained in:
parent
5be6f810a5
commit
b97a1eee25
|
@ -422,6 +422,7 @@ getlist(PyObject* arg, int* length, const char* wrong_length, int type)
|
||||||
|
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
|
|
||||||
|
Py_DECREF(seq);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1289,6 +1290,7 @@ _putdata(ImagingObject* self, PyObject* args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PyErr_Clear(); /* Avoid weird exceptions */
|
PyErr_Clear(); /* Avoid weird exceptions */
|
||||||
|
Py_DECREF(seq);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* 32-bit images */
|
/* 32-bit images */
|
||||||
|
@ -1340,6 +1342,7 @@ _putdata(ImagingObject* self, PyObject* args)
|
||||||
PyErr_Clear(); /* Avoid weird exceptions */
|
PyErr_Clear(); /* Avoid weird exceptions */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Py_DECREF(seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user