From: Matthew Fernandez Date: Sun, 4 Sep 2022 19:36:28 +0000 (-0700) Subject: GD plugin vrml_polygon: fix unchecked allocation failure X-Git-Tag: 6.0.1~9^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12ad693b52da17738cb44eaa9032942a2ae86c4e;p=graphviz GD plugin vrml_polygon: fix unchecked allocation failure --- diff --git a/plugin/gd/gvrender_gd_vrml.c b/plugin/gd/gvrender_gd_vrml.c index a9f76a12d..16272b07e 100644 --- a/plugin/gd/gvrender_gd_vrml.c +++ b/plugin/gd/gvrender_gd_vrml.c @@ -22,16 +22,12 @@ #ifdef HAVE_GD_PNG -/* for N_GNEW() */ -#include - /* for gvcolor_t */ #include #include #include #include -#include #include /* for wind() */ @@ -607,7 +603,7 @@ static void vrml_polygon(GVJ_t *job, pointf * A, int np, int filled) case NODE_OBJTYPE: n = obj->u.n; pen = set_penstyle(job, state->im, brush); - points = N_GGNEW(np, gdPoint); + points = gv_calloc(np, sizeof(gdPoint)); for (i = 0; i < np; i++) { mp = vrml_node_point(job, n, A[i]); points[i].x = ROUND(mp.x);