NetworkManager r4199 - in trunk: . src



Author: dcbw
Date: Tue Oct 21 11:07:42 2008
New Revision: 4199
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4199&view=rev

Log:
2008-10-21  Dan Williams  <dcbw redhat com>

	* src/NetworkManager.c
		- (main): keep the DHCP manager around since it's a singleton; fixes
			a use-after-free exposed by r4196 since the DHCP manager singleton
			variable isn't cleared when the DHCP manager object is finalized



Modified:
   trunk/ChangeLog
   trunk/src/NetworkManager.c

Modified: trunk/src/NetworkManager.c
==============================================================================
--- trunk/src/NetworkManager.c	(original)
+++ trunk/src/NetworkManager.c	Tue Oct 21 11:07:42 2008
@@ -47,6 +47,7 @@
 #include "nm-named-manager.h"
 #include "nm-dbus-manager.h"
 #include "nm-supplicant-manager.h"
+#include "nm-dhcp-manager.h"
 #include "nm-netlink-monitor.h"
 #include "nm-vpn-manager.h"
 #include "nm-logging.h"
@@ -215,8 +216,9 @@
 	NMPolicy *policy = NULL;
 	NMVPNManager *vpn_manager = NULL;
 	NMNamedManager *named_mgr = NULL;
-	NMDBusManager *	dbus_mgr = NULL;
-	NMSupplicantManager * sup_mgr = NULL;
+	NMDBusManager *dbus_mgr = NULL;
+	NMSupplicantManager *sup_mgr = NULL;
+	NMDHCPManager *dhcp_mgr = NULL;
 
 	GOptionEntry options[] = {
 		{"no-daemon", 0, 0, G_OPTION_ARG_NONE, &become_daemon, "Don't become a daemon", NULL},
@@ -327,6 +329,12 @@
 		goto done;
 	}
 
+	dhcp_mgr = nm_dhcp_manager_get ();
+	if (!dhcp_mgr) {
+		nm_warning ("Failed to start the DHCP manager.");
+		goto done;
+	}
+
 	/* Start our DBus service */
 	if (!nm_dbus_manager_start_service (dbus_mgr)) {
 		nm_warning ("Failed to start the dbus manager.");
@@ -355,6 +363,9 @@
 	if (named_mgr)
 		g_object_unref (named_mgr);
 
+	if (dhcp_mgr)
+		g_object_unref (dhcp_mgr);
+
 	if (sup_mgr)
 		g_object_unref (sup_mgr);
 



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