From 4b4385bd443a3b3c3769f2cbfe7b7e0414adaf34 Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Sat, 17 Sep 2016 19:14:31 +0200 Subject: [PATCH] Remove free Don't need it since we aren't malloc'ing --- collector/cpu_dragonfly.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/collector/cpu_dragonfly.go b/collector/cpu_dragonfly.go index 511468a0..2bfa76ff 100644 --- a/collector/cpu_dragonfly.go +++ b/collector/cpu_dragonfly.go @@ -97,16 +97,9 @@ int getCPUTimes(int *ncpu, struct exported_cputime **cputime) { *cputime = &xp_t[0]; - // free(&cp_t); - return 0; } - -void freeCPUTimes(double *cpu_times) { - free(cpu_times); -} - */ import "C" @@ -156,8 +149,6 @@ func (c *statCollector) Update(ch chan<- prometheus.Metric) (err error) { if C.getCPUTimes(&ncpu, &cpuTimesC) == -1 { return errors.New("could not retrieve CPU times") } - // TODO: Remember to free variables - // defer C.freeCPUTimes(cpuTimesC) cpuTimes := (*[1 << 30]C.struct_exported_cputime)(unsafe.Pointer(cpuTimesC))[:ncpu:ncpu]