[network-manager-applet/NMA_0_8] editor: don't crash in edit_done_cb() when connection is invalid (rh #704848)



commit 96c41bf6caddddb768b6704c9aa8f50de6cbc1f7
Author: JiÅ?í KlimeÅ¡ <jklimes redhat com>
Date:   Tue May 17 14:10:25 2011 +0200

    editor: don't crash in edit_done_cb() when connection is invalid (rh #704848)
    
    info structure was g_free()d in connection_updated_cb() and then used by
    g_signal_emit().

 src/connection-editor/nm-connection-list.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index f225ba5..d8a2e0c 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -768,6 +768,7 @@ edit_done_cb (NMConnectionEditor *editor, gint response, GError *error, gpointer
 			                   info->orig_scope,
 			                   connection_updated_cb,
 			                   info);
+			g_signal_emit (info->list, list_signals[EDITING_DONE], 0, 0);
 		} else {
 			g_warning ("%s: invalid connection after update: bug in the "
 			           "'%s' / '%s' invalid: %d",
@@ -777,8 +778,11 @@ edit_done_cb (NMConnectionEditor *editor, gint response, GError *error, gpointer
 			connection_updated_cb (info->list,
 			                       NM_SETTINGS_CONNECTION_INTERFACE (connection),
 			                       edit_error,
-			                       info);
+			                       NULL);
 			g_error_free (edit_error);
+
+			g_signal_emit (info->list, list_signals[EDITING_DONE], 0, 0);
+			g_free (info);
 		}
 		break;
 	case GTK_RESPONSE_NONE:



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