From e8158ec1b19baf5c9c19fbc019e8180baad806e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Thu, 22 Jul 2004 13:46:25 +0000 Subject: [PATCH] Fixed leak. Don't set .timeout anymore. * netload.c: (glibtop_get_netload_s): Fixed leak. * proctime.c: (glibtop_get_proc_time_s): Don't set .timeout anymore. --- sysdeps/linux/ChangeLog | 5 +++++ sysdeps/linux/netload.c | 1 + sysdeps/linux/proctime.c | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sysdeps/linux/ChangeLog b/sysdeps/linux/ChangeLog index a1adc463..b0e03dc5 100644 --- a/sysdeps/linux/ChangeLog +++ b/sysdeps/linux/ChangeLog @@ -1,3 +1,8 @@ +2004-07-22 Benoît Dejean + + * netload.c: (glibtop_get_netload_s): Fixed leak. + * proctime.c: (glibtop_get_proc_time_s): Don't set .timeout anymore. + 2004-07-17 Benoît Dejean * Makefile.am: diff --git a/sysdeps/linux/netload.c b/sysdeps/linux/netload.c index ae7ea0c1..b6a7a215 100644 --- a/sysdeps/linux/netload.c +++ b/sysdeps/linux/netload.c @@ -416,6 +416,7 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, else buf->scope6 = GLIBTOP_IF_IN6_SCOPE_UNKNOWN; + freeifaddrs(ifa0); buf->flags |= _glibtop_sysdeps_netload_6; } /* IPV6 */ diff --git a/sysdeps/linux/proctime.c b/sysdeps/linux/proctime.c index eb1c2d2b..f7da99f2 100644 --- a/sysdeps/linux/proctime.c +++ b/sysdeps/linux/proctime.c @@ -70,9 +70,11 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid) buf->cutime = strtoull (p, &p, 0); buf->cstime = strtoull (p, &p, 0); - p = skip_multiple_token (p, 2); + p = skip_multiple_token (p, 3); - buf->timeout = strtoull (p, &p, 0); + // timeout is 0 on 2.4 and "thread_number" on 2.6 + // lets skip it (using previous skip_multiple_token) + // buf->timeout = strtoull (p, &p, 0); buf->it_real_value = strtoull (p, &p, 0); buf->start_time = strtoull (p, &p, 0);