From nobody@FreeBSD.org  Sun Apr 25 06:28:41 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5663C106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 25 Apr 2010 06:28:41 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 45AAF8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 25 Apr 2010 06:28:41 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o3P6SfH0055045
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 25 Apr 2010 06:28:41 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o3P6SeTJ055044;
	Sun, 25 Apr 2010 06:28:40 GMT
	(envelope-from nobody)
Message-Id: <201004250628.o3P6SeTJ055044@www.freebsd.org>
Date: Sun, 25 Apr 2010 06:28:40 GMT
From: Bryan Venteicher <bryanv@daemoninthecloset.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: cpufreq-applet memory leak [PATCH]
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         146033
>Category:       ports
>Synopsis:       x11/gnome-applets: cpufreq-applet memory leak [PATCH]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 25 06:30:02 UTC 2010
>Closed-Date:    Thu May 13 19:45:21 UTC 2010
>Last-Modified:  Thu May 13 19:50:01 UTC 2010
>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@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:
Responsible-Changed-From-To: freebsd-ports-bugs->gnome 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Apr 25 08:22:32 UTC 2010 
Responsible-Changed-Why:  
Fix synopsis and assign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=146033 
State-Changed-From-To: open->feedback 
State-Changed-By: mezz 
State-Changed-When: Wed Apr 28 02:52:32 UTC 2010 
State-Changed-Why:  
Please resend patch, but actually attach in the email this time. Look at 
here: http://www.freebsd.org/cgi/query-pr.cgi?pr=146033 As you can see, it 
is impossible for us to copy and paste or download the attach from the PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=146033 

From: Bryan Venteicher <bryanv@daemoninthecloset.org>
To: mezz@FreeBSD.org, bug-followup@FreeBSD.org, bryanv@daemoninthecloset.org
Cc: mezz@FreeBSD.org
Subject: Re: ports/146033: x11/gnome-applets: cpufreq-applet memory leak
 [PATCH]
Date: Sun, 2 May 2010 21:45:11 -0500 (CDT)

 ------=_Part_7_278908925.1272854711403
 Content-Type: text/plain; charset=utf-8
 Content-Transfer-Encoding: 7bit
 
 
 
 ----- Original Message -----
 From: mezz@FreeBSD.org
 To: bryanv@daemoninthecloset.org, mezz@FreeBSD.org, gnome@FreeBSD.org
 Sent: Tuesday, April 27, 2010 9:52:50 PM
 Subject: Re: ports/146033: x11/gnome-applets: cpufreq-applet memory leak [PATCH]
 
 Synopsis: x11/gnome-applets: cpufreq-applet memory leak [PATCH]
 
 State-Changed-From-To: open->feedback
 State-Changed-By: mezz
 State-Changed-When: Wed Apr 28 02:52:32 UTC 2010
 State-Changed-Why: Please resend patch, but actually attach in the email
 this time. Look at
 here: http://www.freebsd.org/cgi/query-pr.cgi?pr=146033 As you can see,
 it is impossible for us to copy and paste or download the attach from
 the PR.
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=146033
 
 ------=_Part_7_278908925.1272854711403
 Content-Type: text/x-patch; name=cpufreq.diff
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=cpufreq.diff
 
 --- 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);
 
 
 ------=_Part_7_278908925.1272854711403--
State-Changed-From-To: feedback->closed 
State-Changed-By: kwm 
State-Changed-When: Thu May 13 19:43:29 UTC 2010 
State-Changed-Why:  
Committed, thanks! 

However please attach patches in the future instead of inline. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=146033 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/146033: commit references a PR
Date: Thu, 13 May 2010 19:43:13 +0000 (UTC)

 kwm         2010-05-13 19:43:05 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11/gnome-applets    Makefile 
     x11/gnome-applets/files patch-cpufreq-freebsd 
   Log:
   Fix some memory leaks in the cpufreq applet.
   
   PR:             ports/146033
   Submitted by:   Bryan Venteicher <bryanv@daemoninthecloset.org>
   
   Revision  Changes    Path
   1.129     +1 -0      ports/x11/gnome-applets/Makefile
   1.7       +11 -3     ports/x11/gnome-applets/files/patch-cpufreq-freebsd
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
