From 360dfb906ba4198767735a44ac40b46605b4c501 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 17 Nov 2022 17:14:41 -0800 Subject: [PATCH] fdpgen getEdgeList: use cgraph wrapper for allocation The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h wrappers except (1) they are header-only and (2) they live in a directory (cgraph) that is at the root of the dependency tree. The long term plan is to replace all use of lib/common/memory.h with lib/cgraph/alloc.h. --- lib/fdpgen/layout.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/fdpgen/layout.c b/lib/fdpgen/layout.c index d699a8195..dbaf2d930 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -588,7 +588,6 @@ static int ecmp(const void *v1, const void *v2) */ static erec *getEdgeList(node_t * n, graph_t * g) { - erec *erecs; int deg = DEG(n); int i; double dx, dy; @@ -596,7 +595,7 @@ static erec *getEdgeList(node_t * n, graph_t * g) node_t *m; /* freed in expandCluster */ - erecs = N_NEW(deg + 1, erec); + erec *erecs = gv_calloc(deg + 1, sizeof(erec)); i = 0; for (e = agfstedge(g, n); e; e = agnxtedge(g, e, n)) { if (aghead(e) == n) -- 2.50.1