Fix memory leaks reported by coverity scan in
cnxk_tim_parse_clk_list() and cnxk_tim_parse_ring_ctl_list()
functions on not freeing strduped memory.
Coverity issue: 374990 374991
Fixes: 8a3d58c189f ("event/cnxk: add option to control timer adapters")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
char *f = s;
if (s == NULL || !strlen(s))
- return;
+ goto free;
while (*s) {
if (*s == '[')
s++;
}
+free:
free(f);
}
int i = 0;
if (str == NULL || !strlen(str))
- return;
+ goto free;
tok = strtok(str, "-");
while (tok != NULL && src[i] != ROC_TIM_CLK_SRC_INVALID) {
i++;
}
+free:
free(str);
}