forked from enlightenment/efl
atspi bridge - fix leak on error found by coverity
fix CID 1353604
This commit is contained in:
parent
2ef7d310d0
commit
bb34df4b47
|
@ -1130,18 +1130,18 @@ _action_actions_get(const Eldbus_Service_Interface *iface, const Eldbus_Message
|
||||||
Eo *obj = _bridge_object_from_path(bridge, obj_path);
|
Eo *obj = _bridge_object_from_path(bridge, obj_path);
|
||||||
Eina_List *actions;
|
Eina_List *actions;
|
||||||
Eldbus_Message *ret;
|
Eldbus_Message *ret;
|
||||||
Eldbus_Message_Iter *iter, *iter_array;
|
Eldbus_Message_Iter *iter, *iter_array = NULL;
|
||||||
|
|
||||||
ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, ELM_INTERFACE_ATSPI_ACTION_MIXIN, msg);
|
ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, ELM_INTERFACE_ATSPI_ACTION_MIXIN, msg);
|
||||||
|
|
||||||
ret = eldbus_message_method_return_new(msg);
|
ret = eldbus_message_method_return_new(msg);
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL);
|
if (!ret) goto error;
|
||||||
|
|
||||||
iter = eldbus_message_iter_get(ret);
|
iter = eldbus_message_iter_get(ret);
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
|
if (!iter) goto error;
|
||||||
|
|
||||||
iter_array = eldbus_message_iter_container_new(iter, 'a', "sss");
|
iter_array = eldbus_message_iter_container_new(iter, 'a', "sss");
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(iter_array, NULL);
|
if (!iter_array) goto error;
|
||||||
|
|
||||||
actions = elm_interface_atspi_action_actions_get(obj);
|
actions = elm_interface_atspi_action_actions_get(obj);
|
||||||
|
|
||||||
|
@ -1157,10 +1157,13 @@ _action_actions_get(const Eldbus_Service_Interface *iface, const Eldbus_Message
|
||||||
if (key) free(key);
|
if (key) free(key);
|
||||||
id++;
|
id++;
|
||||||
}
|
}
|
||||||
|
eldbus_message_iter_container_close(iter, iter_array);
|
||||||
eldbus_message_iter_container_close(iter, iter_array);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
error:
|
||||||
|
if (iter_array) eldbus_message_iter_container_close(iter, iter_array);
|
||||||
|
if (ret) eldbus_message_unref(ret);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eldbus_Message *
|
static Eldbus_Message *
|
||||||
|
|
Loading…
Reference in New Issue