Some of the failures cases inside the nic_xstats_display()
function doesn't free the allocated memory for the xstats and
their names, memory is freed now.
Fixes:
e2aae1c1 ("ethdev: remove name from extended statistic fetch")
Fixes:
22561383 ("app: replace dump_cfg by proc_info")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
if (len != rte_eth_xstats_get_names(
port_id, xstats_names, len)) {
printf("Cannot get xstat names\n");
- return;
+ goto err;
}
printf("###### NIC extended statistics for port %-2d #########\n",
ret = rte_eth_xstats_get(port_id, xstats, len);
if (ret < 0 || ret > len) {
printf("Cannot get xstats\n");
- free(xstats);
- return;
+ goto err;
}
for (i = 0; i < len; i++)
printf("%s############################\n",
nic_stats_border);
+err:
free(xstats);
free(xstats_names);
}