[gdm] display-access-file: fix early free



commit ae4ace01f8bf25e32062fab75199845147a44b6a
Author: Ray Strode <rstrode redhat com>
Date:   Wed May 16 14:04:51 2018 -0400

    display-access-file: fix early free
    
    The unused function gdm_display_access_file_remove_display frees
    some variables and then tries to use them.
    
    For completeness, this commit moves the free() calls to the
    appropriate place in the code.
    
    A subsequent commit will drop the function.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=796176

 daemon/gdm-display-access-file.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/daemon/gdm-display-access-file.c b/daemon/gdm-display-access-file.c
index 9bf818d..c6d0135 100644
--- a/daemon/gdm-display-access-file.c
+++ b/daemon/gdm-display-access-file.c
@@ -598,9 +598,6 @@ gdm_display_access_file_remove_display (GdmDisplayAccessFile  *file,
                                        number,
                                        name_length,
                                        name);
-        g_free (address);
-        g_free (number);
-        g_free (name);
 
         if (auth_entry != NULL) {
                 XauDisposeAuth (auth_entry);
@@ -625,6 +622,9 @@ gdm_display_access_file_remove_display (GdmDisplayAccessFile  *file,
                 }
         }
 
+        g_free (address);
+        g_free (number);
+        g_free (name);
 
         if (result == FALSE) {
                 g_set_error (error,


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