Coverity reported that an argument for sizeof was used improperly.
We should allocate memory for value size that pointer points to,
instead of pointer size itself.
Coverity issue: 144523, 144521
Fixes:
7ac16a3660c0 ("app/proc-info: support xstats by ID and by name")
Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
int ret, i;
static const char *nic_stats_border = "########################";
- values = malloc(sizeof(values) * len);
+ values = malloc(sizeof(*values) * len);
if (values == NULL) {
printf("Cannot allocate memory for xstats\n");
return;
printf("Cannot get xstats count\n");
return;
}
- values = malloc(sizeof(values) * len);
+ values = malloc(sizeof(*values) * len);
if (values == NULL) {
printf("Cannot allocate memory for xstats\n");
return;