Commit 88127dae authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Masahiro Yamada

kconfig/symbol.c: use correct pointer type argument for sizeof

sym_arr is of type struct symbol **.
So in malloc we need sizeof(struct symbol *).

The problem was indicated by coccinelle.
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent ae6b289a
...@@ -1061,7 +1061,7 @@ struct symbol **sym_re_search(const char *pattern) ...@@ -1061,7 +1061,7 @@ struct symbol **sym_re_search(const char *pattern)
} }
if (sym_match_arr) { if (sym_match_arr) {
qsort(sym_match_arr, cnt, sizeof(struct sym_match), sym_rel_comp); qsort(sym_match_arr, cnt, sizeof(struct sym_match), sym_rel_comp);
sym_arr = malloc((cnt+1) * sizeof(struct symbol)); sym_arr = malloc((cnt+1) * sizeof(struct symbol *));
if (!sym_arr) if (!sym_arr)
goto sym_re_search_free; goto sym_re_search_free;
for (i = 0; i < cnt; i++) for (i = 0; i < cnt; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment