Bug 83282 - memory leak
Summary: memory leak
Alias: None
Product: Red Hat Linux Beta
Classification: Retired
Component: libgnomeui
Version: beta3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Brian Stein
QA Contact:
Depends On:
Blocks: 79579
TreeView+ depends on / blocked
Reported: 2003-02-01 14:08 UTC by Brian Stein
Modified: 2013-03-01 05:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-02-17 23:17:25 UTC

Attachments (Terms of Use)

Description Arjan van de Ven 2003-02-01 14:08:47 UTC
vals[i].length = strlen (tmp);
  vals[i++].value = g_strdup(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;
   for (list = client->static_args; list; list = g_list_next (list))
@@ -499,6 +498,9 @@
   client_set_value (client, SmRestartCommand, SmLISTofARRAY8, i, vals);
+  g_free(tmp);
   g_free (vals);

Comment 1 Havoc Pennington 2003-02-01 14:59:04 UTC

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@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 18:17:01 UTC
Commited upstream to both branches.

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