Don't g_object_unref a NULL object for event variant
authorMike Gorse <mgorse@novell.com>
Sun, 19 Feb 2012 22:23:42 +0000 (16:23 -0600)
committerMike Gorse <mgorse@novell.com>
Sun, 19 Feb 2012 22:23:42 +0000 (16:23 -0600)
If we get an event with what appears to be an accessible as the variant
but we do not succeed in marshalling the accessible (possibly because it
is the null path), do not unref the null object. Stops a glib warning.

atspi/atspi-event-listener.c

index b397d6f..4581f82 100644 (file)
@@ -907,7 +907,8 @@ _atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data)
        accessible = _atspi_dbus_return_accessible_from_iter (&iter_variant);
        g_value_init (&e.any_data, ATSPI_TYPE_ACCESSIBLE);
        g_value_set_instance (&e.any_data, accessible);
-       g_object_unref (accessible);    /* value now owns it */
+       if (accessible)
+         g_object_unref (accessible);  /* value now owns it */
       }
       break;
     }