From 26d062aaf3947c6012aca90a59cec12f3b8475ee Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 21 Dec 2022 19:00:31 -0800 Subject: [PATCH] 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. --- lib/neatogen/embed_graph.c | 5 ----- 1 file changed, 5 deletions(-) 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++) -- 2.50.1