The compiler multiplies by sizeof *var_spec for us here, so doing
it ourselves writes past the end of the allocated space.
Tracked down with valgrind.
Reported-by: bojo42 <bojo42@gmail.com>
var_spec = xrealloc (var_spec, sizeof (*var_spec) * (idx + 1));
/* xrealloc (unlike realloc) doesn't initialise its memory to 0 */
- memset (var_spec + n_var_specs * sizeof (*var_spec),
+ memset (var_spec + n_var_specs,
0,
(n_var_specs - idx + 1) * sizeof (*var_spec));
n_var_specs = idx + 1;