In the function `makeGraphData()` memory is allocated in various places,
but not all allocated memory is freed at the end of this function. This
commit fixes this by calling `free()` on the pointers `edges`, `edists`
and `ewgts`.
vtx_data *graph;
node_t** nodes;
int ne = agnedges(g); /* upper bound */
- int *edges;
+ int *edges = NULL;
float *ewgts = NULL;
node_t *np;
edge_t *ep;
*nedges = ne;
if (nodedata)
- *nodedata = nodes;
+ *nodedata = nodes;
else
- free (nodes);
+ free (nodes);
freePM(ps);
+ free(edges);
+ free(edists);
+ free(ewgts);
return graph;
}