ports/146033: cpufreq-applet memory leak [PATCH]

Bryan Venteicher bryanv at daemoninthecloset.org
Sun Apr 25 06:30:03 UTC 2010


>Number:         146033
>Category:       ports
>Synopsis:       cpufreq-applet memory leak [PATCH]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 25 06:30:02 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Bryan Venteicher
>Release:        8.0-STABLE
>Organization:
>Environment:
FreeBSD agonize.daemoninthecloset.org 8.0-STABLE FreeBSD 8.0-STABLE #14: Fri Apr 23 04:20:33 CDT 2010     bryanv at agonize.daemoninthecloset.org:/usr/obj/usr/src/sys/AGONIZE  amd64
>Description:
The FreeBSD patch for cpufreq-applet in x11/gnome-applets introduces a couple of of memory leaks.
>How-To-Repeat:

>Fix:
--- a/files/patch-cpufreq-freebsd	2010-04-25 00:24:34.700967984 -0500
+++ b/files/patch-cpufreq-freebsd	2010-04-25 00:24:47.166172634 -0500
@@ -219,7 +219,7 @@
  cpufreq_utils_display_error (const gchar *message,
 --- cpufreq/src/cpufreq-monitor-sysctl.c.orig	Wed Feb 28 14:03:58 2007
 +++ cpufreq/src/cpufreq-monitor-sysctl.c	Wed Feb 28 14:28:47 2007
-@@ -0,0 +1,176 @@
+@@ -0,0 +1,185 @@
 +/*
 + * Copyright (C) 2001, 2002 Free Software Foundation
 + *
@@ -305,6 +305,9 @@
 +	   fmax = atoi ((gchar *) list->data);
 +	   fmin = atoi ((gchar *) g_list_nth_data (list, (g_list_length (list) - 1)));
 +
++	   g_list_foreach (list, (GFunc) g_free, NULL);
++	   g_list_free (list);
++
 +	   g_object_get (G_OBJECT (monitor), "cpu", &mon_cpu, NULL);
 +	   len = sizeof (ifreq);
 +	   freq_oid = g_strdup_printf ("dev.cpu.%d.freq", 0);
@@ -314,6 +317,8 @@
 +	       		 return FALSE;
 +	   }
 +
++	   g_free (freq_oid);
++
 +	   ifreq *= 1000;
 +
 +	   if (ifreq == fmax)
@@ -330,6 +335,8 @@
 +			 "max-frequency", fmax,
 +			 NULL);
 +
++	   g_free (governor);
++
 +	   return TRUE;
 +}
 +
@@ -356,8 +363,10 @@
 +			 return NULL;
 +
 +	   levels = g_malloc (len);
-+	   if (sysctl (mib, 4, levels, &len, NULL, 0) == -1)
++	   if (sysctl (mib, 4, levels, &len, NULL, 0) == -1) {
++			 g_free (levels);
 +	       		 return NULL;
++	   }
 +
 +	   levelsp = g_strsplit (levels, " ", 0);
 +	   g_free (levels);

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list