From: Mike Gorse Date: Mon, 17 Sep 2012 16:16:08 +0000 (-0500) Subject: Don't check for NULL when calling _atspi_application_new X-Git-Tag: AT_SPI2_CORE_2_5_92~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c21b42d31fd19c28bca9417c66bbd5c9fa4c6f8;p=platform%2Fupstream%2Fat-spi2-core.git Don't check for NULL when calling _atspi_application_new g_object_new will error out rather than return NULL when out of memory, so no need to check its return value. --- diff --git a/atspi/atspi-application.c b/atspi/atspi-application.c index 49124baa..90391908 100644 --- a/atspi/atspi-application.c +++ b/atspi/atspi-application.c @@ -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; } diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 0366fc45..fa7ca643 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -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);