stats = realloc(stats, stats->sz + stats->cluster_node_size);
if (stats == NULL)
SET_ERR_JMP(ENOMEM, err, "Realloc failed");
+ *stats_in = NULL;
/* Clear the new struct cluster_node area */
cluster = RTE_PTR_ADD(stats, stats->sz),
cluster->stat.hz = rte_get_timer_hz();
node = graph_node_id_to_ptr(graph, id);
if (node == NULL)
- SET_ERR_JMP(ENOENT, err, "Failed to find node %s in graph %s",
+ SET_ERR_JMP(ENOENT, free, "Failed to find node %s in graph %s",
graph_node->node->name, graph->name);
cluster->nodes[cluster->nb_nodes++] = node;
*stats_in = stats;
return 0;
+free:
+ free(stats);
err:
return -rte_errno;
}