Skip to content

Commit 2fbaadc

Browse files
wiredfoolradarhere
andauthored
Apply suggestions from code review
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
1 parent 477f457 commit 2fbaadc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/_imagingft.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ font_render(FontObject *self, PyObject *args) {
943943
PyObject *imagePtr = PyObject_GetAttrString(image, "ptr");
944944
if (!imagePtr) {
945945
PyMem_Del(glyph_info);
946+
Py_DECREF(image);
946947
return NULL;
947948
}
948949
im = (Imaging)PyCapsule_GetPointer(imagePtr, IMAGING_MAGIC);

src/_imagingmorph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ match(PyObject *self, PyObject *args) {
189189
if (lut[lut_idx]) {
190190
PyObject *coordObj = Py_BuildValue("(nn)", col_idx, row_idx);
191191
if (!coordObj) {
192-
Py_XDECREF(ret);
192+
Py_DECREF(ret);
193193
return NULL;
194194
}
195195
PyList_Append(ret, coordObj);
@@ -238,7 +238,7 @@ get_on_pixels(PyObject *self, PyObject *args) {
238238
if (row[col_idx]) {
239239
PyObject *coordObj = Py_BuildValue("(nn)", col_idx, row_idx);
240240
if (!coordObj) {
241-
Py_XDECREF(ret);
241+
Py_DECREF(ret);
242242
return NULL;
243243
}
244244
PyList_Append(ret, coordObj);

0 commit comments

Comments
 (0)