Merge branch 'master' of git+ssh://doffm@git.freedesktop.org/git/at-spi2/at-spi2...
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / accessible-marshaller.c
index 6e9de23..30d6b33 100644 (file)
@@ -40,15 +40,21 @@ spi_dbus_return_object (DBusMessage *message, AtkObject *obj, gboolean unref)
 
   path = atk_dbus_object_to_path (obj);
 
-  if (unref)
+  if (obj && unref)
     g_object_unref (obj);
 
+  if (!path)
+    path = g_strdup (SPI_DBUS_PATH_NULL);
+
   reply = dbus_message_new_method_return (message);
   if (reply)
     {
-      dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, path,
+      dbus_message_append_args (reply, DBUS_TYPE_OBJECT_PATH, &path,
                                 DBUS_TYPE_INVALID);
     }
+
+  g_free (path);
+
   return reply;
 }