X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=action_graph.c;fp=action_graph.c;h=f517b5c4fe8f805ac1608e22ca4c806d66b6a2e5;hb=8b0d92dd99af987b1c7c842b7d588439367fd58e;hp=38b1ec9a0e5f0596ad58f78c788bcddd7be38c5b;hpb=e7f963be66a9ee9bae65a11bd7f66d52d465271f;p=collection4.git diff --git a/action_graph.c b/action_graph.c index 38b1ec9..f517b5c 100644 --- a/action_graph.c +++ b/action_graph.c @@ -38,6 +38,23 @@ struct graph_def_s }; typedef struct graph_def_s graph_def_t; +static void graph_def_free (graph_def_t *gd) +{ + size_t i; + + if (gd == NULL) + return; + + for (i = 0; i < gd->data_sources_num; i++) + { + free (gd->data_sources[i].file); + free (gd->data_sources[i].name); + free (gd->data_sources[i].legend); + } + free (gd->data_sources); + free (gd); +} /* }}} void graph_def_free */ + static int graph_def_add_ds (graph_def_t *gd, /* {{{ */ const char *file, const char *in_ds_name, size_t ds_name_len) @@ -212,7 +229,7 @@ int action_graph (void) /* {{{ */ (unsigned long) i, gd->data_sources[i].name, gd->data_sources[i].file); } - /* FIXME: Free gd */ + graph_def_free (gd); return (0); } /* }}} int action_graph */