Check NULL for dev->disconnect 95/101495/1
authorDeokhyun Kim <dukan.kim@samsung.com>
Wed, 30 Nov 2016 05:33:00 +0000 (14:33 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 1 Dec 2016 09:09:59 +0000 (18:09 +0900)
[Problem] bluez crashes when disconnecting hid fails
[Cause & Measure] dev->disconnect is already unrefed but tries again with NULL
[Checking Method] Launch VR Controller App wihtout GearVR

Change-Id: Iee9cd0d6793fac6c2c4f7ec54040293321383e7a
Signed-off-by: Injun Yang <injun.yang@samsung.com>
src/device.c

index 87eb5d3..618d5bb 100644 (file)
@@ -2481,6 +2481,9 @@ static DBusMessage *disconnect_profile(DBusConnection *conn, DBusMessage *msg,
        if (err == 0)
                return NULL;
 
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+       if (dev->disconnect)
+#endif
        dbus_message_unref(dev->disconnect);
        dev->disconnect = NULL;