On 31.05.2022 10:23, Yuanjun Gong wrote:
> Free the table[i].sym field of the invalid sym_entry since
> it is malloc'ed data.
It would help if you said whether this was just an observation from
e.g. static code analysis vs you actually having observed the tool
running out of memory. This is a short-lived process after all, so
"leaking" memory is not normally much of a problem.
> --- a/xen/tools/symbols.c
> +++ b/xen/tools/symbols.c
> @@ -422,6 +422,8 @@ static void build_initial_tok_table(void)
> table[pos] = table[i];
> learn_symbol(table[pos].sym, table[pos].len);
> pos++;
> + } else {
> + free(table[i].sym);
Indentation is wrong here.
Jan