plug a few memory leaks

This commit is contained in:
Matthias Clasen 2008-09-17 03:15:42 +00:00
parent 6a8cf98d04
commit cc940de6a3
4 changed files with 53 additions and 1 deletions

11
data-leak.patch Normal file
View File

@ -0,0 +1,11 @@
diff -up gdm-2.23.92/gui/simple-greeter/gdm-user.c.data-leak gdm-2.23.92/gui/simple-greeter/gdm-user.c
--- gdm-2.23.92/gui/simple-greeter/gdm-user.c.data-leak 2008-09-16 22:07:39.000000000 -0400
+++ gdm-2.23.92/gui/simple-greeter/gdm-user.c 2008-09-16 22:07:07.000000000 -0400
@@ -1093,6 +1093,7 @@ frame_pixbuf (GdkPixbuf *source)
cairo_to_pixbuf (data, dest);
cairo_destroy (cr);
+ g_free (data);
return dest;
}

View File

@ -16,7 +16,7 @@
Summary: The GNOME Display Manager
Name: gdm
Version: 2.23.92
Release: 6%{?dist}
Release: 7%{?dist}
Epoch: 1
License: GPLv2+
Group: User Interface/X
@ -81,6 +81,12 @@ Requires: audit-libs >= %{libauditver}
Patch1: xkb-groups.patch
Patch2: gdm-2.23.92-force-active-vt.patch
Patch3: gdm-2.23.92-save-root-window.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=552578
Patch4: username-leak.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=552578
Patch5: data-leak.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=552578
Patch6: ssid-leak.patch
# Fedora-specific
Patch99: gdm-2.23.1-fedora-logo.patch
@ -105,6 +111,10 @@ multiple simulanteous logged in users.
%patch1 -p1 -b .xkb-groups
%patch2 -p1 -b .force-active-vt
%patch3 -p1 -b .save-root-window
%patch4 -p1 -b .username-leak
%patch5 -p1 -b .data-leak
%patch6 -p1 -b .ssid-leak
%patch99 -p1 -b .fedora-logo
autoreconf
@ -306,6 +316,9 @@ fi
%{_datadir}/gnome-2.0/ui/GNOME_FastUserSwitchApplet.xml
%changelog
* Tue Sep 16 2008 Matthias Clasen <mclasen@redhat.com> - 1:2.23.92-7
- Plug a few memory leaks
* Tue Sep 16 2008 Ray Strode <rstrode@redhat.com> - 1:2.23.92-6
- Use _XROOTPMAP_ID instead of _XSETROOT_ID

11
ssid-leak.patch Normal file
View File

@ -0,0 +1,11 @@
diff -up gdm-2.23.92/gui/simple-greeter/gdm-user-manager.c.ssid-leak gdm-2.23.92/gui/simple-greeter/gdm-user-manager.c
--- gdm-2.23.92/gui/simple-greeter/gdm-user-manager.c.ssid-leak 2008-09-16 22:15:20.000000000 -0400
+++ gdm-2.23.92/gui/simple-greeter/gdm-user-manager.c 2008-09-16 22:16:02.000000000 -0400
@@ -667,6 +667,7 @@ add_sessions_for_user (GdmUserManager *m
maybe_add_session_for_user (manager, user, ssid);
}
+ g_ptr_array_foreach (sessions, (GFunc)g_free, NULL);
g_ptr_array_free (sessions, TRUE);
out:

17
username-leak.patch Normal file
View File

@ -0,0 +1,17 @@
diff -up gdm-2.23.92/gui/simple-greeter/gdm-user-manager.c.username-leak gdm-2.23.92/gui/simple-greeter/gdm-user-manager.c
--- gdm-2.23.92/gui/simple-greeter/gdm-user-manager.c.username-leak 2008-09-16 22:00:14.000000000 -0400
+++ gdm-2.23.92/gui/simple-greeter/gdm-user-manager.c 2008-09-16 22:00:36.000000000 -0400
@@ -1147,11 +1147,13 @@ process_ck_history_line (GdmUserManager
user = gdm_user_manager_get_user (manager, username);
if (user == NULL) {
g_debug ("GdmUserManager: unable to lookup user '%s'", username);
+ g_free (username);
return;
}
g_object_set (user, "login-frequency", frequency, NULL);
g_signal_emit (manager, signals [USER_LOGIN_FREQUENCY_CHANGED], 0, user);
+ g_free (username);
}
static gboolean