[Xfce4-commits] <xfce4-xkb-plugin:4.10_panel_support> Don't leak memory in debug macros

Igor Slepchin noreply at xfce.org
Fri Apr 19 01:56:03 CEST 2013


Updating branch refs/heads/4.10_panel_support
         to 19ca46d4e7d905f99ef3182afc0679d8c06fdde2 (commit)
       from 5348715a5c23f5439ef451a42dbdda0078720567 (commit)

commit 19ca46d4e7d905f99ef3182afc0679d8c06fdde2
Author: Igor Slepchin <igor.slepchin at gmail.com>
Date:   Thu Apr 18 19:07:28 2013 -0400

    Don't leak memory in debug macros

 panel-plugin/xkb-config.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/xkb-config.h b/panel-plugin/xkb-config.h
index c91a734..6c702be 100644
--- a/panel-plugin/xkb-config.h
+++ b/panel-plugin/xkb-config.h
@@ -110,13 +110,17 @@ gint              xkb_config_get_max_layout_number        (void);
 
 #define XKB_DEBUG_CONFIG_REC(crec, msg) g_printf("DUMPING CONFIG REC [[[%s]]] {%p}: ", msg, crec);\
     if (crec) { \
+        gchar *layouts = g_strjoinv (",", crec->layouts); \
+        gchar *variants = g_strjoinv (",", crec->variants); \
         g_printf ("\n\
             model: %s [%p]\n\
             layouts: %s [%p]\n\
             variants: %s [%p]\n", \
                 crec->model, crec->model, \
-                g_strjoinv (",", crec->layouts), crec->layouts, \
-                g_strjoinv (",", crec->variants), crec->variants); \
+                layouts, crec->layouts, \
+                variants, crec->variants); \
+        g_free (layouts); \
+        g_free (variants); \
     } else { \
         g_printf ("NULL\n"); \
     }


More information about the Xfce4-commits mailing list