mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-15 01:34:11 +00:00
Fix a memory leak in top.c (sf.net #3543857)
The leak was caused by commit 8827d61
, attempting to solve a problem with top displaying 10th
process incorrectly.
I think there should be a more elegant solution to this, but I don't know how to find it atm
(it could be due the fact that it's 4am here).
This commit is contained in:
parent
fd9462da5e
commit
1c1feb7db2
@ -725,8 +725,11 @@ static void sp_acopy(struct sorted_process *sp_head, struct process **ar, int ma
|
||||
int x;
|
||||
|
||||
sp_cur = sp_head;
|
||||
for (x = 0; x < max_size && sp_cur != NULL; x++) {
|
||||
for (x = 0; x < max_size && sp_cur != NULL; x++, sp_cur = sp_cur->less)
|
||||
ar[x] = sp_cur->proc;
|
||||
|
||||
|
||||
for (sp_cur = sp_head; sp_cur != NULL;) {
|
||||
sp_tmp = sp_cur;
|
||||
sp_cur = sp_cur->less;
|
||||
free_sp(sp_tmp);
|
||||
|
Loading…
Reference in New Issue
Block a user