From 0454cb8eb9afb78c6c37cfaea734ef40433c9cda Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Wed, 4 Oct 2017 11:08:41 +0000 Subject: [PATCH] additional potential null returns without error set --- _imaging.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_imaging.c b/_imaging.c index ab0ffd916..ec90e1f7f 100644 --- a/_imaging.c +++ b/_imaging.c @@ -2260,12 +2260,14 @@ _font_getmask(ImagingFontObject* self, PyObject* args) _font_text_asBytes(encoded_string, &text); if (!text) { + ImagingError_MemoryError(); return NULL; } im = ImagingNew(self->bitmap->mode, textwidth(self, text), self->ysize); if (!im) { free(text); + ImagingError_MemoryError(); return NULL; } @@ -2297,7 +2299,7 @@ _font_getmask(ImagingFontObject* self, PyObject* args) failed: free(text); ImagingDelete(im); - return NULL; + Py_RETURN_NONE; } static PyObject* @@ -2312,6 +2314,7 @@ _font_getsize(ImagingFontObject* self, PyObject* args) _font_text_asBytes(encoded_string, &text); if (!text) { + ImagingError_MemoryError(); return NULL; }