From: Matthew Fernandez Date: Fri, 2 Sep 2022 00:58:17 +0000 (-0700) Subject: smyrna combineCallback: fix unchecked allocation failure X-Git-Tag: 6.0.1~13^2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dae5c2f10926b836eca2598c4fd8c2ff3f52b5fd;p=graphviz smyrna combineCallback: fix unchecked allocation failure --- diff --git a/cmd/smyrna/polytess.c b/cmd/smyrna/polytess.c index ec9796818..de84563d4 100644 --- a/cmd/smyrna/polytess.c +++ b/cmd/smyrna/polytess.c @@ -9,6 +9,7 @@ *************************************************************************/ #include "polytess.h" +#include #include #include tessPoly TP; @@ -21,9 +22,8 @@ static void CALLBACK combineCallback(GLdouble coords[3], GLdouble *vertex_data[4 (void)vertex_data; (void)weight; - GLdouble *vertex; int i; - vertex = malloc(6 * sizeof(GLdouble)); + GLdouble *vertex = gv_calloc(6, sizeof(GLdouble)); vertex[0] = coords[0]; vertex[1] = coords[1]; vertex[2] = coords[2];