[gdm] display: fix memory leak if AddUserAuthentication called more than once



commit 72716d35788903882200cff8a8588be5b7f357a3
Author: Ray Strode <rstrode redhat com>
Date:   Wed Jan 29 11:01:00 2014 -0500

    display: fix memory leak if AddUserAuthentication called more than once
    
    Noted on downstream bug:
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1020885

 daemon/gdm-display.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index 2e28cac..297b41a 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -225,7 +225,14 @@ gdm_display_real_add_user_authorization (GdmDisplay *display,
         gboolean              res;
 
         g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
-        g_return_val_if_fail (display->priv->access_file != NULL, FALSE);
+
+        if (display->priv->user_access_file != NULL) {
+                g_set_error (error,
+                             G_DBUS_ERROR,
+                             G_DBUS_ERROR_ACCESS_DENIED,
+                             "user access already assigned");
+                return FALSE;
+        }
 
         g_debug ("GdmDisplay: Adding user authorization for %s", username);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]