Don't check for NULL when calling _atspi_application_new
authorMike Gorse <mgorse@suse.com>
Mon, 17 Sep 2012 16:16:08 +0000 (11:16 -0500)
committerMike Gorse <mgorse@suse.com>
Mon, 17 Sep 2012 16:16:08 +0000 (11:16 -0500)
g_object_new will error out rather than return NULL when out of memory,
so no need to check its return value.

atspi/atspi-application.c
atspi/atspi-misc.c

index 49124ba..9039190 100644 (file)
@@ -85,10 +85,7 @@ _atspi_application_new (const gchar *bus_name)
   AtspiApplication *application;
   
   application = g_object_new (ATSPI_TYPE_APPLICATION, NULL);
-  if (application)
-  {
-    application->bus_name = g_strdup (bus_name);
-    application->root = NULL;
-  }
+  application->bus_name = g_strdup (bus_name);
+  application->root = NULL;
   return application;
 }
index 0366fc4..fa7ca64 100644 (file)
@@ -205,7 +205,6 @@ get_application (const char *bus_name)
   if (!bus_name_dup) return NULL;
   // TODO: change below to something that will send state-change:defunct notification if necessary */
   app = _atspi_application_new (bus_name);
-  if (!app) return NULL;
   app->hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
   app->bus = dbus_connection_ref (_atspi_bus ());
   gettimeofday (&app->time_added, NULL);