]> granicus.if.org Git - graphviz/commitdiff
dotgen makeSimpleFlatLabels: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 14 Sep 2022 01:36:42 +0000 (18:36 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 14 Sep 2022 01:39:23 +0000 (18:39 -0700)
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/dotgen/dotsplines.c

index 881b66125657498ce9854c4d0454725a39fe3e95..99b0a7c186c32d1abad56eb05292317ceae6bdc5 100644 (file)
@@ -1073,7 +1073,7 @@ makeSimpleFlatLabels (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt,
     double uminx, umaxx;
     double lminx=0.0, lmaxx=0.0;
 
-    edge_t** earray = N_NEW(cnt, edge_t*);
+    edge_t** earray = gv_calloc(cnt, sizeof(edge_t*));
 
     for (i = 0; i < cnt; i++) {
        earray[i] = edges[ind + i];