Bug 83282 - memory leak
memory leak
Status: CLOSED RAWHIDE
Product: Red Hat Linux Beta
Classification: Retired
Component: libgnomeui (Show other bugs)
beta3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Brian Stein
: Triaged
Depends On:
Blocks: 79579
  Show dependency treegraph
 
Reported: 2003-02-01 09:08 EST by Brian Stein
Modified: 2013-03-01 00:14 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-02-17 18:17:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Arjan van de Ven 2003-02-01 09:08:47 EST
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 09:59:04 EST
http://bugzilla.gnome.org/show_bug.cgi?id=104986
Comment 2 Kjartan Maraas 2003-02-17 17:51:30 EST
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 18:00:33 EST
-  g_free(tmp);


was in my patch
upstream forgot to merge that line
Comment 4 Havoc Pennington 2003-02-17 18:17:25 EST
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 08:51:32 EDT
I'll pull the patch from the srpm then. And close the bug upstream.
Comment 6 Kjartan Maraas 2003-05-01 08:53:05 EDT
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 09:37:34 EDT
I think this is already in gnome cvs
Comment 8 Kjartan Maraas 2003-05-01 12:05:05 EDT
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 12:14:31 EDT
Right, we just came to same conclusion:

2003-02-04  Anders Carlsson  <andersca@codefactory.se>

	* 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 14:17:01 EDT
Commited upstream to both branches.

Note You need to log in before you can comment on or make changes to this bug.