From: Matthew Fernandez Date: Sun, 31 Jul 2022 16:17:16 +0000 (-0700) Subject: Pango plugin gv_get_ps_fontlist: fix unchecked allocation X-Git-Tag: 5.0.1~19^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ee042068b11927241c34b865da3753e56992548;p=graphviz Pango plugin gv_get_ps_fontlist: fix unchecked allocation --- diff --git a/plugin/pango/gvgetfontlist_pango.c b/plugin/pango/gvgetfontlist_pango.c index d91d60d16..c04d1476e 100644 --- a/plugin/pango/gvgetfontlist_pango.c +++ b/plugin/pango/gvgetfontlist_pango.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* FIXME - the following declaration should be removed @@ -338,7 +339,7 @@ static availfont_t *gv_get_ps_fontlist(PangoFontMap * fontmap) pango_font_map_list_families(fontmap, &families, &n_families); /* Setup a pointer to available font structs */ - gv_af_p = N_NEW(GV_FONT_LIST_SIZE, availfont_t); + gv_af_p = gv_calloc(GV_FONT_LIST_SIZE, sizeof(availfont_t)); for (size_t j = 0; j < GV_FONT_LIST_SIZE; j++) { /* get the Graphviz PS font information and create the