Fix size of a zeroed block (#7061)
Vladimir Kobal committed
Oct 14, 2019 at 12:47 UTC
cfcc2ffaa3deddbbc08e100fe51efd55196c0695
1 file changed
+1
-1
collectors/freebsd.plugin/freebsd_sysctl.c
+1
-1
@@ -470,7 +470,7 @@ int do_dev_cpu_temperature(int update_every, usec_t dt) {
470
pcpu_temperature = reallocz(pcpu_temperature, sizeof(int) * number_of_cpus);
471
mib = reallocz(mib, sizeof(int) * number_of_cpus * 4);
472
if (unlikely(number_of_cpus > old_number_of_cpus))
473
- memset(&mib[old_number_of_cpus * 4], 0, 4 * (number_of_cpus - old_number_of_cpus));
473
+ memset(&mib[old_number_of_cpus * 4], 0, sizeof(int) * (number_of_cpus - old_number_of_cpus) * 4);
474
}
475
for (i = 0; i < number_of_cpus; i++) {
476
if (unlikely(!(mib[i * 4])))