- GArray *relations;
- AtspiAccessible *ret = NULL;
- AtspiRelation *relation;
- AtspiRelationType type;
- int i;
- if (source) {
- relations = atspi_accessible_get_relation_set(source, NULL);
- if (relations) {
- for (i = 0; i < relations->len; i++) {
- relation = g_array_index(relations, AtspiRelation *, i);
- type = atspi_relation_get_relation_type(relation);
-
- if (type == search_type) {
- ret = atspi_relation_get_target(relation, 0);
- break;
- }
- }
- g_array_free(relations, TRUE);
+ if (source == NULL)
+ return NULL;
+
+ GArray *relations = atspi_accessible_get_relation_set(source, NULL);
+
+ if (relations == NULL)
+ return NULL;
+
+ AtspiAccessible *ret;
+ for (int i = 0; i < relations->len; ++i) {
+ AtspiRelation *relation = g_array_index(relations, AtspiRelation *, i);
+ AtspiRelationType type = atspi_relation_get_relation_type(relation);
+
+ if (type == search_type) {
+ ret = atspi_relation_get_target(relation, 0);
+ break;