From: Matthew Fernandez Date: Thu, 22 Dec 2022 03:00:31 +0000 (-0800) Subject: neatogen embed_graph: remove free of output parameter X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26d062aaf3947c6012aca90a59cec12f3b8475ee;p=graphviz neatogen embed_graph: remove free of output parameter The only call into this function passes `NULL` for the `coords` parameter. Additionally it did not make much sense to free this pointer on behalf of the caller. This function is not designed to be called in a loop, so if the caller wants their passed-in parameter freed they should do it themselves prior to calling. --- diff --git a/lib/neatogen/embed_graph.c b/lib/neatogen/embed_graph.c index 9f9ac91e4..b1d4c222b 100644 --- a/lib/neatogen/embed_graph.c +++ b/lib/neatogen/embed_graph.c @@ -45,11 +45,6 @@ void embed_graph(vtx_data * graph, int n, int dim, DistType *** Coords, Queue Q; DistType max_dist = 0; - if (coords != NULL) { - free(coords[0]); - free(coords); - } - /* this matrix stores the distance between each node and each "pivot" */ *Coords = coords = N_GNEW(dim, DistType *); for (i = 0; i < dim; i++)