Skip to content

Commit 93d5f8b

Browse files
authored
Merge pull request #7549 from radarhere/imagefont_memory
2 parents 12022fe + 086ca27 commit 93d5f8b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/_imagingft.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,9 @@ font_render(FontObject *self, PyObject *args) {
885885
PyMem_Del(glyph_info);
886886
return NULL;
887887
}
888-
id = PyLong_AsSsize_t(PyObject_GetAttrString(image, "id"));
888+
PyObject *imageId = PyObject_GetAttrString(image, "id");
889+
id = PyLong_AsSsize_t(imageId);
890+
Py_XDECREF(imageId);
889891
im = (Imaging)id;
890892

891893
x_offset -= stroke_width;

0 commit comments

Comments
 (0)