From 4ce6c682d8b6d90ec1e862c796687a44ee1ca6c1 Mon Sep 17 00:00:00 2001 From: Monsta Date: Fri, 28 Nov 2014 19:12:18 +0300 Subject: fix weird logic, prevent memleak --- capplets/keyboard/mate-keyboard-properties-xkb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/capplets/keyboard/mate-keyboard-properties-xkb.c b/capplets/keyboard/mate-keyboard-properties-xkb.c index 4f795719..7ccc0273 100644 --- a/capplets/keyboard/mate-keyboard-properties-xkb.c +++ b/capplets/keyboard/mate-keyboard-properties-xkb.c @@ -61,10 +61,8 @@ set_model_text (GtkWidget * picker, gchar * value) XklConfigItem *ci = xkl_config_item_new (); char *model = NULL; - if (value != NULL) { + if (value != NULL && value[0] != '\0') { model = g_strdup(value); - if (model != NULL && model[0] == '\0') - model = NULL; } if (model == NULL) { -- cgit v1.2.1