[gnome-control-center] keyboard: Fix leak in settings_get_binding()



commit 99ef49087597c7e884cdc14d0e9332887db52d7f
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Sat Oct 17 21:25:17 2015 +0200

    keyboard: Fix leak in settings_get_binding()
    
    This fixes:
    ==5944== 64,392 bytes in 4,223 blocks are definitely lost in loss record 16,020 of 16,045
    ==5944==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==5944==    by 0x1445EFCC: g_malloc (gmem.c:94)
    ==5944==    by 0x1445F2AE: g_malloc_n (gmem.c:330)
    ==5944==    by 0x144981DC: g_variant_get_strv (gvariant.c:1572)
    ==5944==    by 0x48FA45: settings_get_binding (cc-keyboard-item.c:369)
    ==5944==    by 0x48FA9D: binding_changed (cc-keyboard-item.c:384)
    ==5944==    by 0x141C3E2F: g_cclosure_marshal_VOID__STRINGv (gmarshal.c:1794)
    ==5944==    by 0x141BFBE3: _g_closure_invoke_va (gclosure.c:864)
    ==5944==    by 0x141DA3E7: g_signal_emit_valist (gsignal.c:3292)
    ==5944==    by 0x141DB55F: g_signal_emit (gsignal.c:3439)
    ==5944==    by 0x13EDC81D: g_settings_real_change_event (gsettings.c:386)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756762

 panels/keyboard/cc-keyboard-item.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-item.c b/panels/keyboard/cc-keyboard-item.c
index eef75be..887bdc6 100644
--- a/panels/keyboard/cc-keyboard-item.c
+++ b/panels/keyboard/cc-keyboard-item.c
@@ -368,6 +368,7 @@ settings_get_binding (GSettings  *settings,
 
       str_array = g_variant_get_strv (variant, NULL);
       value = g_strdup (str_array[0]);
+      g_free (str_array);
     }
   g_variant_unref (variant);
 


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