From: Heinrich Schuchardt Date: Wed, 8 Nov 2017 21:09:59 +0000 (+0100) Subject: kconfig/symbol.c: use correct pointer type argument for sizeof X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=8414004c51e6158812d77f503252770f2027466a;p=carl9170fw.git 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: Heinrich Schuchardt Signed-off-by: Masahiro Yamada Signed-off-by: Christian Lamparter --- diff --git a/config/symbol.c b/config/symbol.c index 20136ff..3c8bd9b 100644 --- a/config/symbol.c +++ b/config/symbol.c @@ -1061,7 +1061,7 @@ struct symbol **sym_re_search(const char *pattern) } if (sym_match_arr) { 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) goto sym_re_search_free; for (i = 0; i < cnt; i++)