cursor/convert_font.c: malloc cannot guarantee that the memory allocated is always successful

This commit is contained in:
ganjing 2020-07-27 11:22:40 +08:00 committed by Simon Ser
parent e53e0edf0f
commit 1ea08d748c

View File

@ -499,6 +499,11 @@ output_interesting_cursors()
struct reconstructed_glyph *glyphs =
malloc(n * sizeof(*glyphs));
if (!glyphs) {
printf("reconstructed_glyph malloc failed\n");
abort();
}
for (i = 0; i < n; ++i) {
struct glyph *cursor, *mask;
find_cursor_and_mask(interesting_cursors[i].source_name,