From: Matthew Fernandez Date: Fri, 18 Nov 2022 01:14:41 +0000 (-0800) Subject: fdpgen expandCluster: use cgraph wrapper for allocation X-Git-Tag: 7.0.3~7^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7c9ef2a75e479586b481f90530ebb7c3dd99b58;p=graphviz 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. --- 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);