1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-12 19:06:36 +00:00

- Fix memleaks in ${top(_mem)} code on FreeBSD (thanks to Petr Holub)

- Update ChangeLog


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@602 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Roman Bogorodskiy 2006-03-21 11:32:59 +00:00
parent 1fb0efb5f1
commit 25c3c7cbc9
2 changed files with 20 additions and 4 deletions

View File

@ -1,5 +1,9 @@
# $Id$
2006-03-21
* Fixed ${top(_mem)} related code on FreeBSD (with help of Petr
Holub <hopet@users.sourceforge.net>)
2006-03-15
* Removed bmp-infopipe dependency from 1.4.1 and 1.9999 ebuilds for Gentoo
(Gentoo bug# 125226).

View File

@ -515,7 +515,7 @@ get_freq(char *p_client_buffer, size_t client_buffer_size,
snprintf(p_client_buffer, client_buffer_size,
p_format, freq/divisor);
else
snprintf(p_client_buffer, client_buffer_size, p_format, 0f);
snprintf(p_client_buffer, client_buffer_size, p_format, 0.0f);
}
void
@ -560,7 +560,7 @@ update_diskio()
di = dev_select[dn].position;
dev = &statinfo_cur.dinfo->devices[di];
diskio_CUrrent += dev->bytes[DEVSTAT_READ] +
diskio_current += dev->bytes[DEVSTAT_READ] +
dev->bytes[DEVSTAT_WRITE];
}
@ -655,7 +655,7 @@ proc_find_top(struct process **cpu, struct process **mem)
qsort(processes, j - 1, sizeof (struct process), comparemem);
for (i = 0; i < 10; i++) {
struct process *tmp;
struct process *tmp, *ttmp;
tmp = malloc(sizeof (struct process));
tmp->pid = processes[i].pid;
@ -663,12 +663,17 @@ proc_find_top(struct process **cpu, struct process **mem)
tmp->totalmem = processes[i].totalmem;
tmp->name = strdup(processes[i].name);
ttmp = mem[i];
if (ttmp != NULL) {
free(ttmp->name);
free(ttmp);
}
mem[i] = tmp;
}
qsort(processes, j - 1, sizeof (struct process), comparecpu);
for (i = 0; i < 10; i++) {
struct process *tmp;
struct process *tmp, *ttmp;
tmp = malloc(sizeof (struct process));
tmp->pid = processes[i].pid;
@ -676,6 +681,11 @@ proc_find_top(struct process **cpu, struct process **mem)
tmp->totalmem = processes[i].totalmem;
tmp->name = strdup(processes[i].name);
ttmp = cpu[i];
if (ttmp != NULL) {
free(ttmp->name);
free(ttmp);
}
cpu[i] = tmp;
}
@ -686,6 +696,8 @@ proc_find_top(struct process **cpu, struct process **mem)
mem[i]->pid, mem[i]->totalmem);
}
#endif
for (i = 0; i < j; free(processes[i++].name));
free(processes);
}
}