From a4a076c5dfb14d056361ed0df0f473bc53163ef9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 15 Sep 2008 00:25:41 +0000 Subject: [PATCH] Plug some memory leaks --- ListenObjs-leak.patch | 13 +++++++++++++ gnome-session.spec | 15 ++++++++++++++- inhibitor-leak.patch | 21 +++++++++++++++++++++ previous_id-leak.patch | 18 ++++++++++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 ListenObjs-leak.patch create mode 100644 inhibitor-leak.patch create mode 100644 previous_id-leak.patch diff --git a/ListenObjs-leak.patch b/ListenObjs-leak.patch new file mode 100644 index 0000000..c112e1c --- /dev/null +++ b/ListenObjs-leak.patch @@ -0,0 +1,13 @@ +diff -up gnome-session-2.23.92/gnome-session/gsm-xsmp-server.c.ListenObj-leak gnome-session-2.23.92/gnome-session/gsm-xsmp-server.c +--- gnome-session-2.23.92/gnome-session/gsm-xsmp-server.c.ListenObj-leak 2008-09-14 13:36:09.000000000 -0400 ++++ gnome-session-2.23.92/gnome-session/gsm-xsmp-server.c 2008-09-14 13:38:00.000000000 -0400 +@@ -606,6 +606,9 @@ gsm_xsmp_server_finalize (GObject *objec + + g_return_if_fail (xsmp_server->priv != NULL); + ++ IceFreeListenObjs (xsmp_server->priv->num_xsmp_sockets, ++ xsmp_server->priv->xsmp_sockets); ++ + if (xsmp_server->priv->client_store != NULL) { + g_object_unref (xsmp_server->priv->client_store); + } diff --git a/gnome-session.spec b/gnome-session.spec index a81cb5f..5aad8c6 100644 --- a/gnome-session.spec +++ b/gnome-session.spec @@ -12,7 +12,7 @@ Summary: GNOME session manager Name: gnome-session Version: 2.23.92 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.gnome.org Source0: http://download.gnome.org/sources/gnome-session/2.23/%{name}-%{version}.tar.bz2 Source1: redhat-default-session @@ -63,6 +63,13 @@ Requires(pre): GConf2 >= %{gconf2_version} Requires(post): GConf2 >= %{gconf2_version} Requires(preun): GConf2 >= %{gconf2_version} +# http://bugzilla.gnome.org/show_bug.cgi?id=552292 +Patch0: ListenObjs-leak.patch +# http://bugzilla.gnome.org/show_bug.cgi?id=552293 +Patch1: previous_id-leak.patch +# http://bugzilla.gnome.org/show_bug.cgi?id=552294 +Patch2: inhibitor-leak.patch + %description gnome-session manages a GNOME desktop session. It starts up the other core @@ -70,6 +77,9 @@ GNOME components and handles logout and saving the session. %prep %setup -q +%patch0 -p1 -b .ListenObjs-leak +%patch1 -p1 -b .previous_id-leak +%patch2 -p1 -b .inhibitor-leak %build @@ -168,6 +178,9 @@ fi %changelog +* Sun Sep 14 2008 Matthias Clasen - 2.23.92-2 +- Plug memory leaks + * Mon Sep 8 2008 Jon McCann - 2.23.92-1 - Update to 2.23.92 diff --git a/inhibitor-leak.patch b/inhibitor-leak.patch new file mode 100644 index 0000000..67ab48c --- /dev/null +++ b/inhibitor-leak.patch @@ -0,0 +1,21 @@ +diff -up gnome-session-2.23.92/gnome-session/gsm-inhibit-dialog.c.inhibitor-leak gnome-session-2.23.92/gnome-session/gsm-inhibit-dialog.c +--- gnome-session-2.23.92/gnome-session/gsm-inhibit-dialog.c.inhibitor-leak 2008-09-14 19:48:46.000000000 -0400 ++++ gnome-session-2.23.92/gnome-session/gsm-inhibit-dialog.c 2008-09-14 19:47:48.000000000 -0400 +@@ -496,6 +496,7 @@ add_inhibitor (GsmInhibitDialog *dialog, + + /* FIXME: get info from xid */ + ++ desktop_file = NULL; + name = NULL; + pixbuf = NULL; + freeme = NULL; +@@ -602,6 +603,9 @@ add_inhibitor (GsmInhibitDialog *dialog, + if (pixbuf != NULL) { + g_object_unref (pixbuf); + } ++ if (desktop_file != NULL) { ++ egg_desktop_file_free (desktop_file); ++ } + } + + static gboolean diff --git a/previous_id-leak.patch b/previous_id-leak.patch new file mode 100644 index 0000000..7889b28 --- /dev/null +++ b/previous_id-leak.patch @@ -0,0 +1,18 @@ +diff -up gnome-session-2.23.92/gnome-session/gsm-xsmp-client.c.previous_id-leak.patch gnome-session-2.23.92/gnome-session/gsm-xsmp-client.c +--- gnome-session-2.23.92/gnome-session/gsm-xsmp-client.c.previous_id-leak.patch 2008-09-14 18:57:14.000000000 -0400 ++++ gnome-session-2.23.92/gnome-session/gsm-xsmp-client.c 2008-09-14 18:57:30.000000000 -0400 +@@ -857,13 +857,12 @@ register_client_callback (SmsConn con + g_debug ("GsmXSMPClient: Sending initial SaveYourself"); + SmsSaveYourself (conn, SmSaveLocal, False, SmInteractStyleNone, False); + client->priv->current_save_yourself = SmSaveLocal; +- +- free (previous_id); + } + + gsm_client_set_status (GSM_CLIENT (client), GSM_CLIENT_REGISTERED); + + g_free (id); ++ free (previous_id); + + return TRUE; + }