[network-manager-applet/nma-0-9-8] editor: fix mem leak when calling gtk_editable_get_chars
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/nma-0-9-8] editor: fix mem leak when calling gtk_editable_get_chars
- Date: Thu, 3 Apr 2014 20:31:59 +0000 (UTC)
commit d779aefb2c16f3ab11e6ceb8fa658705a57b86c8
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 c23e241..1ab87c9 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
@@ -577,7 +577,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 39f3235..63c646b 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
@@ -518,7 +518,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 282392d..aba5a93 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 7ce09ee..2f4ae24 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]