Use reallocz instead of realloc
Vladimir Kobal committed
Dec 6, 2016 at 15:43 UTC
1a2ee65b3e41b785a0aa3fc202c3fd6f29380eea
1 file changed
+2
-2
src/freebsd_sysctl.c
+2
-2
@@ -186,7 +186,7 @@ int do_freebsd_sysctl(int update_every, unsigned long long dt) {
186
do_cpu_cores = 0;
187
error("DISABLED: cpu.cpuXX");
188
} else {
189
- pcpu_cp_time = realloc(pcpu_cp_time, sizeof(cp_time) * ncpus);
189
+ pcpu_cp_time = reallocz(pcpu_cp_time, sizeof(cp_time) * ncpus);
190
191
for (i = 0; i < ncpus; i++) {
192
if (unlikely(getsysctl("kern.cp_times", pcpu_cp_time, sizeof(cp_time) * ncpus))) {
@@ -235,7 +235,7 @@ int do_freebsd_sysctl(int update_every, unsigned long long dt) {
235
error("DISABLED: system.intr");
236
} else {
237
nintr = intrcnt_size / sizeof(u_long);
238
- intrcnt = realloc(intrcnt, nintr * sizeof(u_long));
238
+ intrcnt = reallocz(intrcnt, nintr * sizeof(u_long));
239
if (unlikely(getsysctl("hw.intrcnt", intrcnt, nintr * sizeof(u_long)))){
240
do_interrupts = 0;
241
error("DISABLED: system.intr");