[Xfce4-commits] <xfce4-xkb-plugin:master> Plug leak when group_name is NULL.

Jérôme Guelfucci noreply at xfce.org
Sun May 1 10:06:01 CEST 2011


Updating branch refs/heads/master
         to e2b90c777b5a0f107bbe6c60344706ef061f6ba0 (commit)
       from 2955704cf1518d48942346fe1a00db3c871df682 (commit)

commit e2b90c777b5a0f107bbe6c60344706ef061f6ba0
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Sun May 1 09:07:22 2011 +0200

    Plug leak when group_name is NULL.

 panel-plugin/xkb-util.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/xkb-util.c b/panel-plugin/xkb-util.c
index 61b5edf..d0d0230 100644
--- a/panel-plugin/xkb-util.c
+++ b/panel-plugin/xkb-util.c
@@ -66,7 +66,7 @@ xkb_util_get_layout_string (const gchar *group_name, const gchar *variant)
 gchar*
 xkb_util_normalize_group_name (const gchar* group_name)
 {
-    gchar *c = g_strdup (group_name);
+    gchar *c;
     gchar *result;
     gint cut_length;
     gint index_of_na = -1;
@@ -76,9 +76,9 @@ xkb_util_normalize_group_name (const gchar* group_name)
         return NULL;
 
     if (strlen (group_name) <= 3)
-    {
         return g_strdup (group_name);
-    }
+
+    c = g_strdup (group_name);
 
     while (*c)
     {



More information about the Xfce4-commits mailing list