Fixes memory leaks detected by Coverity. These are due to ephemeral
memory allocations not being freed when errors occur.
Coverity issue: 127348
Fixes:
e2aae1c1ced9 ("ethdev: remove name from extended statistic fetch")
Signed-off-by: Remy Horton <remy.horton@intel.com>
if (cnt_xstats != rte_eth_xstats_get_names(
port_id, xstats_names, cnt_xstats)) {
printf("Error: Cannot get xstats lookup\n");
+ free(xstats_names);
return;
}
}
if (cnt_xstats != rte_eth_xstats_get(port_id, xstats, cnt_xstats)) {
printf("Error: Unable to get xstats\n");
+ free(xstats_names);
+ free(xstats);
return;
}