From 1ea08d748cfa86d7395315ca3e52085b0e1c8155 Mon Sep 17 00:00:00 2001 From: ganjing Date: Mon, 27 Jul 2020 11:22:40 +0800 Subject: [PATCH] cursor/convert_font.c: malloc cannot guarantee that the memory allocated is always successful --- cursor/convert_font.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cursor/convert_font.c b/cursor/convert_font.c index 45b6ac6..74e45fb 100644 --- a/cursor/convert_font.c +++ b/cursor/convert_font.c @@ -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, -- 2.7.4