[mutter] display: correctly init and free hostname



commit 12cc0cee2964dbca5ed37648ab4165b10047fa87
Author: Pavel Vasin <rat4vier gmail com>
Date:   Thu Mar 22 21:42:55 2012 +0400

    display: correctly init and free hostname
    
    ==31043== 7 bytes in 1 blocks are definitely lost in loss record 213 of 6,861
    ==31043==    at 0x402B018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==31043==    by 0x417789A: ??? (in /usr/lib/libglib-2.0.so.0.3122.0)
    ==31043==    by 0x4177C42: g_malloc (in /usr/lib/libglib-2.0.so.0.3122.0)
    ==31043==    by 0x418DC3A: g_strdup (in /usr/lib/libglib-2.0.so.0.3122.0)
    ==31043==    by 0x408C470: meta_display_open (display.c:475)
    ==31043==    by 0x40A4D42: meta_run (main.c:552)
    ==31043==    by 0x8048A74: main (mutter.c:96)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672640

 src/core/display.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 46f92b2..6ef744e 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -467,6 +467,8 @@ meta_display_open (void)
       buf[sizeof(buf)-1] = '\0';
       the_display->hostname = g_strdup (buf);
     }
+  else
+    the_display->hostname = NULL;
   the_display->error_trap_synced_at_last_pop = TRUE;
   the_display->error_traps = 0;
   the_display->error_trap_handler = NULL;
@@ -1044,6 +1046,7 @@ meta_display_close (MetaDisplay *display,
   meta_display_free_window_prop_hooks (display);
   meta_display_free_group_prop_hooks (display);
   
+  g_free (display->hostname);
   g_free (display->name);
 
   meta_display_shutdown_keys (display);



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