From d7c9ef2a75e479586b481f90530ebb7c3dd99b58 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 17 Nov 2022 17:14:41 -0800 Subject: [PATCH] fdpgen expandCluster: 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 dbaf2d930..a60363bc3 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -707,14 +707,13 @@ static graph_t *expandCluster(node_t * n, graph_t * cg) erec *ep; erec *next; graph_t *sg = ND_clust(n); - bport_t *pp; int sz = WDEG(n); int idx = 0; double bnd; if (sz != 0) { /* freed in cleanup_subgs */ - pp = N_NEW(sz + 1, bport_t); + bport_t *pp = gv_calloc(sz + 1, sizeof(bport_t)); /* create sorted list of edges of n */ es = ep = getEdgeList(n, cg); -- 2.40.0