coverity/62618: fixing "Wrong sizeof argument"

suspicious_sizeof: Passing argument 168UL /* sizeof (ufunc_T) */ * todo
to function xmalloc and then casting the return value to ufunc_T ** is
suspicious.
This commit is contained in:
Chris Hall
2015-05-05 22:02:18 +12:00
committed by Chris Hall
parent 2393074d5f
commit 7fc7147ad6

View File

@@ -18575,7 +18575,7 @@ void func_dump_profile(FILE *fd)
if (todo == 0) if (todo == 0)
return; /* nothing to dump */ return; /* nothing to dump */
sorttab = xmalloc(sizeof(ufunc_T) * todo); sorttab = xmalloc(sizeof(ufunc_T *) * todo);
for (hi = func_hashtab.ht_array; todo > 0; ++hi) { for (hi = func_hashtab.ht_array; todo > 0; ++hi) {
if (!HASHITEM_EMPTY(hi)) { if (!HASHITEM_EMPTY(hi)) {