]> granicus.if.org Git - graphviz/commitdiff
smyrna Render_Contour2: fix unchecked allocation failure
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 00:59:12 +0000 (17:59 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 00:59:56 +0000 (17:59 -0700)
cmd/smyrna/polytess.c

index de84563d476fc2925bf8a8b8346f34c1e34fbf98..c1b2ccaef30b6839894616c167c43f9c381d56ff 100644 (file)
@@ -77,7 +77,7 @@ static void Set_Winding_Rule(GLUtesselator *tobj, GLenum winding_rule)
 
 static void Render_Contour2(GLUtesselator *tobj, sdot_op* p)
 {
-    GLdouble* d = calloc(p->op.u.polygon.cnt * 3, sizeof(GLdouble));
+    GLdouble *d = gv_calloc(p->op.u.polygon.cnt * 3, sizeof(GLdouble));
     for (size_t x = 0; x < p->op.u.polygon.cnt; x++)
     {
         d[x * 3] = p->op.u.polygon.pts[x].x;