Commit 3110b72e authored by Alexandre Julliard's avatar Alexandre Julliard

mountmgr: Don't crash if connecting to dbus fails.

parent 68208425
...@@ -600,6 +600,9 @@ static DBusMessage *device_by_iface_request( const char *iface ) ...@@ -600,6 +600,9 @@ static DBusMessage *device_by_iface_request( const char *iface )
DBusMessage *request, *reply; DBusMessage *request, *reply;
DBusMessageIter iter; DBusMessageIter iter;
DBusError error; DBusError error;
DBusConnection *connection = get_dhcp_connection();
if (!connection) return NULL;
request = p_dbus_message_new_method_call( "org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager", request = p_dbus_message_new_method_call( "org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager",
"org.freedesktop.NetworkManager", "GetDeviceByIpIface" ); "org.freedesktop.NetworkManager", "GetDeviceByIpIface" );
...@@ -609,7 +612,7 @@ static DBusMessage *device_by_iface_request( const char *iface ) ...@@ -609,7 +612,7 @@ static DBusMessage *device_by_iface_request( const char *iface )
p_dbus_message_iter_append_basic( &iter, DBUS_TYPE_STRING, &iface ); p_dbus_message_iter_append_basic( &iter, DBUS_TYPE_STRING, &iface );
p_dbus_error_init( &error ); p_dbus_error_init( &error );
reply = p_dbus_connection_send_with_reply_and_block( get_dhcp_connection(), request, -1, &error ); reply = p_dbus_connection_send_with_reply_and_block( connection, request, -1, &error );
p_dbus_message_unref( request ); p_dbus_message_unref( request );
if (!reply) if (!reply)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment