mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-09 23:04:45 +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();
|
||||
|
||||
Py_DECREF(seq);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -1289,6 +1290,7 @@ _putdata(ImagingObject* self, PyObject* args)
|
|||
}
|
||||
}
|
||||
PyErr_Clear(); /* Avoid weird exceptions */
|
||||
Py_DECREF(seq);
|
||||
}
|
||||
} else {
|
||||
/* 32-bit images */
|
||||
|
@ -1340,6 +1342,7 @@ _putdata(ImagingObject* self, PyObject* args)
|
|||
PyErr_Clear(); /* Avoid weird exceptions */
|
||||
break;
|
||||
}
|
||||
Py_DECREF(seq);
|
||||
}
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
|
|
Loading…
Reference in New Issue
Block a user