diff options
author | Thomas Haller <thaller@redhat.com> | 2015-09-11 12:13:35 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-09-11 12:13:35 +0200 |
commit | 6fddffa7d7a9065d33157fbbf90ad1c989c5fed7 (patch) | |
tree | f137e7c100e4cfe5de08ab92f3ec21882c3d07bc | |
parent | 843b97d5a640d7e3bc798fdf31a7f63378e01967 (diff) | |
download | network-manager-applet-6fddffa7d7a9065d33157fbbf90ad1c989c5fed7.tar.gz |
c-e: fix memleak of @zone in CEPageGeneral:ui_to_setting()
-rw-r--r-- | src/connection-editor/page-general.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/connection-editor/page-general.c b/src/connection-editor/page-general.c index 85b4d743..477c0be2 100644 --- a/src/connection-editor/page-general.c +++ b/src/connection-editor/page-general.c @@ -373,7 +373,6 @@ static void ui_to_setting (CEPageGeneral *self) { CEPageGeneralPrivate *priv = CE_PAGE_GENERAL_GET_PRIVATE (self); - char *zone; char *uuid = NULL; GtkTreeIter iter; gboolean autoconnect = FALSE, everyone = FALSE; @@ -382,12 +381,12 @@ ui_to_setting (CEPageGeneral *self) * are received from FirewallD asynchronously; got_zones indicates we are ready. */ if (priv->got_zones) { - zone = gtk_combo_box_text_get_active_text (priv->firewall_zone); - - if (g_strcmp0 (zone, FIREWALL_ZONE_DEFAULT) == 0) - zone = NULL; - g_object_set (priv->setting, NM_SETTING_CONNECTION_ZONE, zone, NULL); + char *zone; + zone = gtk_combo_box_text_get_active_text (priv->firewall_zone); + g_object_set (priv->setting, NM_SETTING_CONNECTION_ZONE, + (g_strcmp0 (zone, FIREWALL_ZONE_DEFAULT) != 0) ? zone : NULL, + NULL); g_free (zone); } |