[network-manager-openvpn/NM_0_8] core: don't clean up management socket if it wasn't set up in the first place



commit 536fba9522803fe3e5f365064f37b0687123fa82
Author: Dan Williams <dcbw redhat com>
Date:   Mon Apr 4 18:33:33 2011 -0500

    core: don't clean up management socket if it wasn't set up in the first place

 src/nm-openvpn-service.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 8ac0d26..1115efc 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -287,9 +287,12 @@ nm_openvpn_disconnect_management_socket (NMOpenvpnPlugin *plugin)
 	if (!io_data)
 		return;
 
-	g_source_remove (io_data->socket_channel_eventid);
-	g_io_channel_shutdown (io_data->socket_channel, FALSE, NULL);
-	g_io_channel_unref (io_data->socket_channel);
+	if (io_data->socket_channel_eventid)
+		g_source_remove (io_data->socket_channel_eventid);
+	if (io_data->socket_channel) {
+		g_io_channel_shutdown (io_data->socket_channel, FALSE, NULL);
+		g_io_channel_unref (io_data->socket_channel);
+	}
 
 	g_free (io_data->username);
 	g_free (io_data->proxy_username);



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