mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
bye warning, bye possible mem leak
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@653 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
b2ab78cd0c
commit
1f7486f699
@ -481,6 +481,7 @@ void get_ibm_acpi_fan(char *buf, size_t client_buffer_size);
|
||||
void get_ibm_acpi_temps(void);
|
||||
void get_ibm_acpi_volume(char *buf, size_t client_buffer_size);
|
||||
void get_ibm_acpi_brightness(char *buf, size_t client_buffer_size);
|
||||
void get_cpu_count();
|
||||
|
||||
struct ibm_acpi_struct {
|
||||
unsigned int temps[8];
|
||||
|
@ -364,6 +364,9 @@ void determine_longstat(char * buf) {
|
||||
|
||||
void get_cpu_count()
|
||||
{
|
||||
if (info.cpu_usage) {
|
||||
return;
|
||||
}
|
||||
char buf[256];
|
||||
if (stat_fp == NULL)
|
||||
stat_fp = open_file("/proc/stat", &rep);
|
||||
@ -386,7 +389,6 @@ void get_cpu_count()
|
||||
}
|
||||
}
|
||||
info.cpu_usage = malloc((info.cpu_count + 1) * sizeof(float));
|
||||
|
||||
}
|
||||
|
||||
#define TMPL_LONGSTAT "%*s %llu %llu %llu %llu %llu %llu %llu %llu"
|
||||
|
Loading…
Reference in New Issue
Block a user