From 7fa1a62cd351a3e50bdc49788c560b6f76164c3c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 17 Jan 2011 23:19:25 -0600 Subject: [PATCH] libnm-glib: don't crash when adding new connections that aren't waited upon If we're not waiting for this connection to show up after an AddConnection operation, we don't need to touch anything addinfo-related. --- libnm-glib/nm-remote-settings.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c index 3369860e8c..e4b0bc55bb 100644 --- a/libnm-glib/nm-remote-settings.c +++ b/libnm-glib/nm-remote-settings.c @@ -155,6 +155,8 @@ add_connection_info_complete (NMRemoteSettings *self, AddConnectionInfo *info, GError *error) { + g_return_if_fail (info != NULL); + info->callback (info->self, error ? NULL : info->connection, error, info->callback_data); add_connection_info_dispose (self, info); } @@ -242,7 +244,8 @@ connection_init_result_cb (NMRemoteConnection *remote, /* If there's a pending AddConnection request, complete that here before * signaling new-connection. */ - add_connection_info_complete (self, addinfo, NULL); + if (addinfo) + add_connection_info_complete (self, addinfo, NULL); /* Finally, let users know of the new connection now that it has all * its settings and is valid.