From 8784ec5c6f5fd07308e3c6c191fe10fa85cff8bf Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Mon, 13 Apr 2009 17:52:54 +0000 Subject: [PATCH] Fix an issue with accessing a bad memory address in my previous patch. I had the correct code locally, but I committed the bad version. Without this, libgtop would crash. Approved by: portmgr (implicit) --- devel/libgtop/Makefile | 2 +- devel/libgtop/files/patch-sysdeps_freebsd_cpu.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/devel/libgtop/Makefile b/devel/libgtop/Makefile index 829b0c930f31..a7c29a86ce92 100644 --- a/devel/libgtop/Makefile +++ b/devel/libgtop/Makefile @@ -8,7 +8,7 @@ PORTNAME= libgtop PORTVERSION= 2.26.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel gnome MASTER_SITES= GNOME DIST_SUBDIR= gnome2 diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_cpu.c b/devel/libgtop/files/patch-sysdeps_freebsd_cpu.c index 1aa7021dbb0b..99a3e8ef8346 100644 --- a/devel/libgtop/files/patch-sysdeps_freebsd_cpu.c +++ b/devel/libgtop/files/patch-sysdeps_freebsd_cpu.c @@ -4,7 +4,7 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) { long cpts [CPUSTATES]; -+ long *cp_times; ++ long *cp_times = NULL; struct clockinfo ci; size_t length; int ncpu, i; @@ -16,7 +16,7 @@ + if (sysctlbyname ("kern.cp_times", NULL, &length, NULL, 0) == 0) { + cp_times = g_malloc (length); + length = sizeof(long) * CPUSTATES * (length / (sizeof(long) * CPUSTATES)); -+ if (sysctlbyname ("kern.cp_times", &cp_times, &length, NULL, 0)) { ++ if (sysctlbyname ("kern.cp_times", cp_times, &length, NULL, 0)) { + g_free (cp_times); + cp_times = NULL; + }