mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Add necessary PyMem_Free and fix PyDict_GetItemRef call
This commit is contained in:
parent
40e7f511b3
commit
f5313db9ce
|
@ -1243,8 +1243,8 @@ font_getvarnames(FontObject *self) {
|
|||
}
|
||||
}
|
||||
|
||||
PyMem_Free(list_names_filled);
|
||||
FT_Done_MM_Var(library, master);
|
||||
|
||||
return list_names;
|
||||
}
|
||||
|
||||
|
|
|
@ -723,8 +723,8 @@ PyImaging_LibTiffEncoderNew(PyObject *self, PyObject *args) {
|
|||
|
||||
if (!is_core_tag) {
|
||||
PyObject *tag_type;
|
||||
if (PyDict_GetItemRef(types, key, &tag_type) == 0) {
|
||||
PyErr_SetString(PyExc_KeyError, "unknown tag type");
|
||||
if (PyDict_GetItemRef(types, key, &tag_type) < 0) {
|
||||
return NULL; // Exception has been already set
|
||||
}
|
||||
if (tag_type) {
|
||||
int type_int = PyLong_AsLong(tag_type);
|
||||
|
|
Loading…
Reference in New Issue
Block a user