From 9210ea3780f87305de53c69e66e3cbf93653ba58 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Aug 29 2008 22:24:26 +0000 Subject: Plug a small memory leak --- diff --git a/libgnomekbd.spec b/libgnomekbd.spec index fe2cc2f..9e070f1 100644 --- a/libgnomekbd.spec +++ b/libgnomekbd.spec @@ -1,6 +1,6 @@ Name: libgnomekbd Version: 2.23.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A keyboard configuration library Group: System Environment/Libraries @@ -27,6 +27,8 @@ Requires(pre): GConf2 Requires(post): GConf2 Requires(preun): GConf2 +# http://bugzilla.gnome.org/show_bug.cgi?id=549874 +Patch0: list-leak.patch %description The libgnomekbd package contains a GNOME library which manages @@ -60,6 +62,7 @@ of the keyboard indicator applet. %prep %setup -q +%patch0 -p0 -b .list-leak %build %configure --disable-static --enable-compile-warnings=no @@ -129,6 +132,9 @@ touch --no-create %{_datadir}/icons/hicolor || : %changelog +* Fri Aug 29 2008 Matthias Clasen - 2.23.2-2 +- Plug a small memory leak + * Sun May 11 2008 Matthias Clasen - 2.23.2-1 - Update to 2.23.2 diff --git a/list-leak.patch b/list-leak.patch new file mode 100644 index 0000000..ad179ae --- /dev/null +++ b/list-leak.patch @@ -0,0 +1,62 @@ +Index: libgnomekbd/gkbd-keyboard-config.c +=================================================================== +--- libgnomekbd/gkbd-keyboard-config.c (revision 302) ++++ libgnomekbd/gkbd-keyboard-config.c (working copy) +@@ -325,7 +325,7 @@ + { + GError *gerror = NULL; + gchar *pc; +- GSList *pl; ++ GSList *pl, *l; + + pc = gconf_client_get_string (kbd_config->conf_client, + param_names[0], &gerror); +@@ -347,7 +347,7 @@ + + gkbd_keyboard_config_layouts_reset (kbd_config); + +- pl = gconf_client_get_list (kbd_config->conf_client, ++ l = pl = gconf_client_get_list (kbd_config->conf_client, + param_names[1], + GCONF_VALUE_STRING, &gerror); + if (pl == NULL || gerror != NULL) { +@@ -359,17 +359,17 @@ + } + } + +- while (pl != NULL) { +- xkl_debug (150, "Loaded Kbd layout: [%s]\n", pl->data); ++ while (l != NULL) { ++ xkl_debug (150, "Loaded Kbd layout: [%s]\n", l->data); + gkbd_keyboard_config_layouts_add_full (kbd_config, +- pl->data); +- pl = pl->next; ++ l->data); ++ l = l->next; + } + gkbd_keyboard_config_string_list_reset (&pl); + + gkbd_keyboard_config_options_reset (kbd_config); + +- pl = gconf_client_get_list (kbd_config->conf_client, ++ l = pl = gconf_client_get_list (kbd_config->conf_client, + param_names[2], + GCONF_VALUE_STRING, &gerror); + if (pl == NULL || gerror != NULL) { +@@ -381,12 +381,12 @@ + } + } + +- while (pl != NULL) { +- xkl_debug (150, "Loaded Kbd option: [%s]\n", pl->data); ++ while (l != NULL) { ++ xkl_debug (150, "Loaded Kbd option: [%s]\n", l->data); + gkbd_keyboard_config_options_add_full (kbd_config, +- (const gchar *) pl-> ++ (const gchar *) l-> + data); +- pl = pl->next; ++ l = l->next; + } + gkbd_keyboard_config_string_list_reset (&pl); + }