summaryrefslogtreecommitdiff
path: root/daemon/gdm-display.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2008-03-18 00:19:08 +0000
committerWilliam Jon McCann <mccann@src.gnome.org>2008-03-18 00:19:08 +0000
commit7eae1ae04950cabcdf79657b5cd37140622d3806 (patch)
tree9471215f2ce3e58080083573f7a815c93905d996 /daemon/gdm-display.c
parentca1214f327095f3c080dcf79bee9e4b506d51479 (diff)
downloadgdm-7eae1ae04950cabcdf79657b5cd37140622d3806.tar.gz
Fix a few more mem and fd leaks.
2008-03-17 William Jon McCann <jmccann@redhat.com> * common/gdm-signal-handler.c: (gdm_signal_handler_finalize): * daemon/gdm-display.c: (gdm_display_real_create_authority), (gdm_display_real_add_user_authorization), (gdm_display_constructor): * daemon/gdm-slave.c: (gdm_slave_finalize): * daemon/main.c: (main): Fix a few more mem and fd leaks. svn path=/trunk/; revision=6037
Diffstat (limited to 'daemon/gdm-display.c')
-rw-r--r--daemon/gdm-display.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index 99a9850a..0c5efc29 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -154,7 +154,8 @@ static gboolean
gdm_display_real_create_authority (GdmDisplay *display)
{
GdmDisplayAccessFile *access_file;
- GError *error;
+ GError *error;
+ gboolean res;
g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
g_return_val_if_fail (display->priv->access_file == NULL, FALSE);
@@ -163,15 +164,20 @@ gdm_display_real_create_authority (GdmDisplay *display)
access_file = _create_access_file_for_user (display, "gdm", &error);
if (access_file == NULL) {
- g_critical ("could not create display access file: %s", error->message);
- g_error_free (error);
- return FALSE;
+ g_critical ("could not create display access file: %s", error->message);
+ g_error_free (error);
+ return FALSE;
}
- if (!gdm_display_access_file_add_display (access_file, display,
- &display->priv->x11_cookie,
- &display->priv->x11_cookie_size,
- &error)) {
+ g_free (display->priv->x11_cookie);
+ display->priv->x11_cookie = NULL;
+ res = gdm_display_access_file_add_display (access_file,
+ display,
+ &display->priv->x11_cookie,
+ &display->priv->x11_cookie_size,
+ &error);
+
+ if (! res) {
g_critical ("could not add display to access file: %s", error->message);
g_error_free (error);
@@ -207,6 +213,7 @@ gdm_display_real_add_user_authorization (GdmDisplay *display,
{
GdmDisplayAccessFile *access_file;
GError *access_file_error;
+ gboolean res;
g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
g_return_val_if_fail (display->priv->access_file != NULL, FALSE);
@@ -219,15 +226,16 @@ gdm_display_real_add_user_authorization (GdmDisplay *display,
&access_file_error);
if (access_file == NULL) {
- g_propagate_error (error, access_file_error);
- return FALSE;
+ g_propagate_error (error, access_file_error);
+ return FALSE;
}
- if (!gdm_display_access_file_add_display_with_cookie (access_file,
- display,
- display->priv->x11_cookie,
- display->priv->x11_cookie_size,
- &access_file_error)) {
+ res = gdm_display_access_file_add_display_with_cookie (access_file,
+ display,
+ display->priv->x11_cookie,
+ display->priv->x11_cookie_size,
+ &access_file_error);
+ if (! res) {
g_debug ("GdmDisplay: Unable to add user authorization for %s: %s",
username,
access_file_error->message);
@@ -822,6 +830,7 @@ gdm_display_constructor (GType type,
n_construct_properties,
construct_properties));
+ g_free (display->priv->id);
display->priv->id = g_strdup_printf ("/org/gnome/DisplayManager/Display%u", get_next_display_serial ());
res = register_display (display);