[network-manager-applet/th/rh962449_link_local_dns_server: 1/4] editor: fix mem leak when calling gtk_editable_get_chars



commit bbbdb09bca3a03652cb1e4630b39979226b96349
Author: Thomas Haller <thaller redhat com>
Date:   Fri Sep 27 20:02:40 2013 +0200

    editor: fix mem leak when calling gtk_editable_get_chars
    
    The return value of gtk_editable_get_chars is owned by the caller, so
    calling g_strdup leaks memory.
    
    Signed-off-by: Thomas Haller <thaller redhat com>

 src/connection-editor/ip4-routes-dialog.c |    6 +++---
 src/connection-editor/ip6-routes-dialog.c |    6 +++---
 src/connection-editor/page-ip4.c          |    4 ++--
 src/connection-editor/page-ip6.c          |    4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/connection-editor/ip4-routes-dialog.c b/src/connection-editor/ip4-routes-dialog.c
index 62932ea..0897751 100644
--- a/src/connection-editor/ip4-routes-dialog.c
+++ b/src/connection-editor/ip4-routes-dialog.c
@@ -380,7 +380,7 @@ ip_address_filter_cb (GtkEntry *   entry,
                                                 user_data);
                gtk_editable_insert_text (editable, result, count, position);
                g_free (last_edited);
-               last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+               last_edited = gtk_editable_get_chars (editable, 0, -1);
                g_signal_handlers_unblock_by_func (G_OBJECT (editable),
                                                   G_CALLBACK (ip_address_filter_cb),
                                                   user_data);
@@ -406,7 +406,7 @@ delete_text_cb (GtkEditable *editable,
 
        /* Keep last_edited up-to-date */
        g_free (last_edited);
-       last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+       last_edited = gtk_editable_get_chars (editable, 0, -1);
 
        /* Desensitize the OK button during input to simplify input validation.
         * All routes will be validated on focus-out, which will then re-enable
@@ -564,7 +564,7 @@ uint_filter_cb (GtkEntry *   entry,
                                                 user_data);
                gtk_editable_insert_text (editable, result, count, position);
                g_free (last_edited);
-               last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+               last_edited = gtk_editable_get_chars (editable, 0, -1);
                g_signal_handlers_unblock_by_func (G_OBJECT (editable),
                                                   G_CALLBACK (uint_filter_cb),
                                                   user_data);
diff --git a/src/connection-editor/ip6-routes-dialog.c b/src/connection-editor/ip6-routes-dialog.c
index 21a9458..56525ae 100644
--- a/src/connection-editor/ip6-routes-dialog.c
+++ b/src/connection-editor/ip6-routes-dialog.c
@@ -331,7 +331,7 @@ ip_address_filter_cb (GtkEntry *   entry,
                                                 user_data);
                gtk_editable_insert_text (editable, result, count, position);
                g_free (last_edited);
-               last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+               last_edited = gtk_editable_get_chars (editable, 0, -1);
                g_signal_handlers_unblock_by_func (G_OBJECT (editable),
                                                   G_CALLBACK (ip_address_filter_cb),
                                                   user_data);
@@ -357,7 +357,7 @@ delete_text_cb (GtkEditable *editable,
 
        /* Keep last_edited up-to-date */
        g_free (last_edited);
-       last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+       last_edited = gtk_editable_get_chars (editable, 0, -1);
 
        /* Desensitize the OK button during input to simplify input validation.
         * All routes will be validated on focus-out, which will then re-enable
@@ -505,7 +505,7 @@ uint_filter_cb (GtkEntry *   entry,
                                                 user_data);
                gtk_editable_insert_text (editable, result, count, position);
                g_free (last_edited);
-               last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+               last_edited = gtk_editable_get_chars (editable, 0, -1);
                g_signal_handlers_unblock_by_func (G_OBJECT (editable),
                                                   G_CALLBACK (uint_filter_cb),
                                                   user_data);
diff --git a/src/connection-editor/page-ip4.c b/src/connection-editor/page-ip4.c
index b9aebcc..2bc1536 100644
--- a/src/connection-editor/page-ip4.c
+++ b/src/connection-editor/page-ip4.c
@@ -639,7 +639,7 @@ ip_address_filter_cb (GtkEntry *   entry,
                                                 user_data);
                gtk_editable_insert_text (editable, result, count, position);
                g_free (priv->last_edited);
-               priv->last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+               priv->last_edited = gtk_editable_get_chars (editable, 0, -1);
                g_signal_handlers_unblock_by_func (G_OBJECT (editable),
                                                   G_CALLBACK (ip_address_filter_cb),
                                                   user_data);
@@ -660,7 +660,7 @@ delete_text_cb (GtkEditable *editable,
 
        /* Keep last_edited up-to-date */
        g_free (priv->last_edited);
-       priv->last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+       priv->last_edited = gtk_editable_get_chars (editable, 0, -1);
 }
 
 static gboolean
diff --git a/src/connection-editor/page-ip6.c b/src/connection-editor/page-ip6.c
index a204367..30c2497 100644
--- a/src/connection-editor/page-ip6.c
+++ b/src/connection-editor/page-ip6.c
@@ -621,7 +621,7 @@ ip_address_filter_cb (GtkEntry *   entry,
                                                 user_data);
                gtk_editable_insert_text (editable, result, count, position);
                g_free (priv->last_edited);
-               priv->last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+               priv->last_edited = gtk_editable_get_chars (editable, 0, -1);
                g_signal_handlers_unblock_by_func (G_OBJECT (editable),
                                                   G_CALLBACK (ip_address_filter_cb),
                                                   user_data);
@@ -642,7 +642,7 @@ delete_text_cb (GtkEditable *editable,
 
        /* Keep last_edited up-to-date */
        g_free (priv->last_edited);
-       priv->last_edited = g_strdup (gtk_editable_get_chars (editable, 0, -1));
+       priv->last_edited = gtk_editable_get_chars (editable, 0, -1);
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]