Bug 83282

Summary: memory leak
Product: [Retired] Red Hat Linux Beta Reporter: Brian Stein <bstein>
Component: libgnomeuiAssignee: Brian Stein <bstein>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: beta3CC: bstevens, kmaraas
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-02-17 23:17:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 79579    

Description Arjan van de Ven 2003-02-01 14:08:47 UTC
vals[i].length = strlen (tmp);
  vals[i++].value = g_strdup(tmp);
  g_free(tmp);

.... and vals[] never gets freed.

proposed fix:
--- gnome-client.c~     2003-02-01 15:03:20.000000000 +0100
+++ gnome-client.c      2003-02-01 15:03:20.000000000 +0100
@@ -482,8 +482,7 @@
   vals[i].length = strlen (sm_screen);
   vals[i++].value = (char *)sm_screen;
   vals[i].length = strlen (tmp);
-  vals[i++].value = g_strdup(tmp);
-  g_free(tmp);
+  vals[i++].value = tmp;
 #endif
  
   for (list = client->static_args; list; list = g_list_next (list))
@@ -499,6 +498,9 @@
     }
  
   client_set_value (client, SmRestartCommand, SmLISTofARRAY8, i, vals);
+#ifdef HAVE_GTK_MULTIHEAD
+  g_free(tmp);
+#endif
  
   g_free (vals);
 }
[

Comment 1 Havoc Pennington 2003-02-01 14:59:04 UTC
http://bugzilla.gnome.org/show_bug.cgi?id=104986

Comment 2 Kjartan Maraas 2003-02-17 22:51:30 UTC
Apparently this patch was bad. The first g_free (tmp); should go. It made apps hang.

Comment 3 Arjan van de Ven 2003-02-17 23:00:33 UTC
-  g_free(tmp);


was in my patch
upstream forgot to merge that line

Comment 4 Havoc Pennington 2003-02-17 23:17:25 UTC
we already have this in rawhide I believe, I just didn't close the bug. 
(we don't have the hang part)

Comment 5 Kjartan Maraas 2003-05-01 12:51:32 UTC
I'll pull the patch from the srpm then. And close the bug upstream.

Comment 6 Kjartan Maraas 2003-05-01 12:53:05 UTC
Nothing even remotely similar in the current rawhide RPM. Arjan, could you give me a patch to clean up the missing part wrt current GNOME CVS?

Comment 7 Havoc Pennington 2003-05-01 13:37:34 UTC
I think this is already in gnome cvs

Comment 8 Kjartan Maraas 2003-05-01 16:05:05 UTC
No, it's not. Arjan's patch still applies cleanly and it was just a bad merge on andersca's part that made it break in the first place. I'll reapply it for the next release (both branches)


Comment 9 Havoc Pennington 2003-05-01 16:14:31 UTC
Right, we just came to same conclusion:

2003-02-04  Anders Carlsson  <andersca>

	* libgnomeui/gnome-client.c: (client_set_restart_command):
	Revert fix since it caused brokenness.
	
I thought Anders had *fixed* it not just taken it out ;-)

Comment 10 Kjartan Maraas 2003-05-01 18:17:01 UTC
Commited upstream to both branches.