From: Matthew Fernandez Date: Fri, 18 Nov 2022 01:14:41 +0000 (-0800) Subject: common undoClusterEdges: use cgraph wrapper for allocation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=252e4f7c82c69e061a04a8456f844966d088062a;p=graphviz common undoClusterEdges: 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/common/utils.c b/lib/common/utils.c index 9837b691e..5e79b6a49 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -1211,7 +1211,7 @@ void undoClusterEdges(graph_t * g) if (!ecnt) return; clg = agsubg(g, "__clusternodes",1); agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); - edge_t **edgelist = N_NEW(ecnt, edge_t*); + edge_t **edgelist = gv_calloc(ecnt, sizeof(edge_t*)); for (n = agfstnode(g); n; n = agnxtnode(g, n)) { for (e = agfstout(g, n); e; e = agnxtout(g, e)) { if (ED_compound(e))