Skip to content

Commit

Permalink
Add necessary PyMem_Free and fix PyDict_GetItemRef call
Browse files Browse the repository at this point in the history
  • Loading branch information
lysnikolaou committed Jul 13, 2024
1 parent 40e7f51 commit f5313db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/_imagingft.c
Original file line number Diff line number Diff line change
Expand Up @@ -1243,8 +1243,8 @@ font_getvarnames(FontObject *self) {
}
}

PyMem_Free(list_names_filled);
FT_Done_MM_Var(library, master);

return list_names;
}

Expand Down
4 changes: 2 additions & 2 deletions src/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f5313db

Please sign in to comment.