static volatile int g_signal_pending;
/* Update interval */
double update_interval;
+void *global_cpu = NULL;
/* prototypes for internally used functions */
}
clear_diskio_stats();
+ if(global_cpu != NULL) free(global_cpu);
}
static int string_to_bool(const char *s)
double curtmp;
const char *stat_template = NULL;
unsigned int malloc_cpu_size = 0;
+ extern void* global_cpu;
/* add check for !info.cpu_usage since that mem is freed on a SIGUSR1 */
if (!cpu_setup || !info.cpu_usage) {
malloc_cpu_size = (info.cpu_count + 1) * sizeof(struct cpu_info);
cpu = malloc(malloc_cpu_size);
memset(cpu, 0, malloc_cpu_size);
+ global_cpu = cpu;
}
if (!(stat_fp = open_file("/proc/stat", &rep))) {