From: Matthew Fernandez Date: Sun, 31 Jul 2022 16:15:42 +0000 (-0700) Subject: common moveTo: fix unchecked allocation X-Git-Tag: 5.0.1~19^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91866f1388db5c3cabaad6a2a41a0dfd951cecb4;p=graphviz common moveTo: fix unchecked allocation --- diff --git a/lib/common/ellipse.c b/lib/common/ellipse.c index ceb983bc3..ac87d9b21 100644 --- a/lib/common/ellipse.c +++ b/lib/common/ellipse.c @@ -46,6 +46,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include #ifdef STANDALONE #include @@ -57,7 +58,6 @@ #define MIN(a,b) ((a)<(b)?(a):(b)) #define NEW(t) calloc(1,sizeof(t)) -#define N_NEW(n,t) calloc(n,sizeof(t)) #define PI 3.14159265358979323846 @@ -403,7 +403,7 @@ static int bufsize; static void moveTo(Ppolyline_t *polypath, double x, double y) { bufsize = 100; - polypath->ps = N_NEW(bufsize, pointf); + polypath->ps = gv_calloc(bufsize, sizeof(pointf)); polypath->ps[0].x = x; polypath->ps[0].y = y; polypath->pn = 1;