diff options
author | Monsta <[email protected]> | 2014-11-28 19:15:46 +0300 |
---|---|---|
committer | infirit <[email protected]> | 2014-11-30 22:12:27 +0100 |
commit | f72b253b32f56258eb1a9460ec1b0b2dd52bb55b (patch) | |
tree | 1abda072e8b116bf777d1f37039affb1344a8616 /capplets/network/mate-network-properties.c | |
parent | 4ce6c682d8b6d90ec1e862c796687a44ee1ca6c1 (diff) | |
download | mate-control-center-f72b253b32f56258eb1a9460ec1b0b2dd52bb55b.tar.bz2 mate-control-center-f72b253b32f56258eb1a9460ec1b0b2dd52bb55b.tar.xz |
fix another little memleak by making logic cleaner
Diffstat (limited to 'capplets/network/mate-network-properties.c')
-rw-r--r-- | capplets/network/mate-network-properties.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/capplets/network/mate-network-properties.c b/capplets/network/mate-network-properties.c index d1eaa515..32cd6e7c 100644 --- a/capplets/network/mate-network-properties.c +++ b/capplets/network/mate-network-properties.c @@ -176,12 +176,13 @@ static void cb_add_url (GtkButton *button, gpointer data) { GtkBuilder *builder = GTK_BUILDER (data); - gchar *new_url = NULL; - new_url = g_strdup (gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, "entry_url")))); - if (strlen (new_url) == 0) + const gchar *entry_text = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, "entry_url"))); + if (entry_text == NULL || strlen (entry_text) == 0) { return; - ignore_hosts = g_slist_append(ignore_hosts, new_url); + } + + ignore_hosts = g_slist_append(ignore_hosts, g_strdup (entry_text)); populate_listmodel(GTK_LIST_STORE(model), ignore_hosts); gtk_entry_set_text(GTK_ENTRY (gtk_builder_get_object (builder, "entry_url")), ""); |