Skip to content

Commit ff50e30

Browse files
committed
Fix memory leak in text_layout_raqm on 0 length string
1 parent 6391f2c commit ff50e30

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/_imagingft.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ text_layout_raqm(
275275
if (!text || !size) {
276276
/* return 0 and clean up, no glyphs==no size,
277277
and raqm fails with empty strings */
278+
PyMem_Free(text);
278279
goto failed;
279280
}
280281
set_text = raqm_set_text(rq, text, size);

0 commit comments

Comments
 (0)