fix: xorg crash by referencing null pointer
authorBoram Park <boram1288.park@samsung.com>
Wed, 3 Apr 2013 08:25:49 +0000 (17:25 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 4 Apr 2013 08:51:45 +0000 (17:51 +0900)
Change-Id: If7cbc8ff35d99281930fc030d156b1d9472ffbd6

dbus/xdbg_dbus_server.c
module/xdbg_module.c

index 1a8e95a..b8c1961 100755 (executable)
@@ -199,8 +199,6 @@ _xDbgDBusServerWakeupHandler (pointer data, int error, pointer pRead)
 
     if (FD_ISSET(info->fd, (fd_set*)pRead))
     {
-        dbus_connection_ref (info->conn);
-
         do {
             dbus_connection_read_write_dispatch (info->conn, 0);
         } while (info->conn &&
@@ -208,7 +206,9 @@ _xDbgDBusServerWakeupHandler (pointer data, int error, pointer pRead)
                  dbus_connection_get_dispatch_status (info->conn) ==
                  DBUS_DISPATCH_DATA_REMAINS);
 
-        dbus_connection_unref (info->conn);
+        /* DON'T use info->conn from here. info->conn becomes NULL by
+         * dbus_connection_read_write_dispatch(_xDbgDBusServerMsgFilter)
+         */
     }
 }
 
index b9ea47f..eb5c35e 100644 (file)
@@ -114,4 +114,5 @@ xDbgModuleSetup (pointer module, pointer opts, int *errmaj, int *errmin)
 void
 xDbgModuleTearDown (pointer module)
 {
+    xDbgModuleMainExit (module);
 }