payload->result, v_eui64, payload->node_id,
payload->pan_id, payload->channel, payload->radio_tx_power);
+ if (v_eui64)
+ g_variant_unref(v_eui64);
+
g_free(cb_data);
}
zigbee_service_complete_get_mac(service_object, invocation, payload->result,
v_eui64);
+ if (v_eui64)
+ g_variant_unref(v_eui64);
+
g_free(cb_data);
}
zigbee_service_complete_get_device_info(service_object, invocation,
payload->result, variant);
+ if (variant)
+ g_variant_unref(variant);
+
g_free(cb_data);
}
zigbee_service_complete_get_endpoint_list(service_object, invocation,
payload->result, v_endpoints);
+ if (v_endpoints)
+ g_variant_unref(v_endpoints);
+
g_free(cb_data);
}
zigbee_service_complete_get_cluster_list(service_object, invocation,
payload->result, v_in_clusters, v_out_clusters);
+ if (v_in_clusters)
+ g_variant_unref(v_in_clusters);
+ if (v_out_clusters)
+ g_variant_unref(v_out_clusters);
+
g_free(cb_data);
}
child_t->endpoints, child_t->endpoint_count, TRUE, NULL, NULL);
if (NULL == v_eui64 || NULL == v_endpoints) {
Z_LOGE("Failed to create variant!");
- if (v_eui64)
- g_object_unref(v_eui64);
- if (v_endpoints)
- g_object_unref(v_endpoints);
} else {
zigbee_service_emit_child_joined(service_object,
v_eui64, child_t->endpoint_count, v_endpoints, child_t->node_id);
}
+ if (v_eui64)
+ g_variant_unref(v_eui64);
+ if (v_endpoints)
+ g_variant_unref(v_endpoints);
}
break;
case ZBLIB_SERVICE_NOTI_CHILD_REJOINED: {
else {
zigbee_service_emit_child_left(service_object,
v_eui64, child_left_t->status);
+ g_variant_unref(v_eui64);
}
}
break;
TRUE, NULL, NULL);
if (NULL == v_types || NULL == v_attrs) {
Z_LOGE("Failed to create variant!");
- if (v_types)
- g_variant_unref(v_types);
- if (v_attrs)
- g_variant_unref(v_attrs);
} else {
Z_LOGD("Discover attribute resp");
zigbee_zcl_global_control_emit_discover_attribute_rsp(global_control_object,
attr_t->node_id, attr_t->src_ep, v_types, v_attrs,
attr_t->cluster_id, attr_t->record_length, attr_t->discovery_completed);
}
+ if (v_types)
+ g_variant_unref(v_types);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
break;
}
case ZBLIB_ZCL_GLOBAL_NOTI_WRITE_ATTR_STRUCTURED_RSP: {
v_status, v_attrs, v_indicator, v_index,
attr_t->cluster_id, attr_t->record_length,
attr_t->node_id, attr_t->src_ep);
+ if (v_status)
+ g_variant_unref(v_status);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ if (v_indicator)
+ g_variant_unref(v_indicator);
break;
}
case ZBLIB_ZCL_GLOBAL_NOTI_DISCOVER_CMDS_RECEIVED_RSP: {
v_commands, attr_t->cluster_id, attr_t->list_count,
attr_t->node_id, attr_t->src_ep, attr_t->discovery_completed);
}
+ if (v_commands)
+ g_variant_unref(v_commands);
break;
}
case ZBLIB_ZCL_GLOBAL_NOTI_DISCOVER_CMDS_GENERATED_RSP: {
v_commands, attr_t->cluster_id, attr_t->list_count,
attr_t->node_id, attr_t->src_ep, attr_t->discovery_completed);
}
+ if (v_commands)
+ g_variant_unref(v_commands);
break;
}
case ZBLIB_ZCL_GLOBAL_NOTI_DISCOVER_ATTR_EXT_RSP: {
attr_t->access_list, attr_t->list_count, TRUE, NULL, NULL);
if (NULL == v_attrs_type || NULL == v_attrs || NULL == v_access) {
Z_LOGE("Failed to create variant!");
- if (v_attrs_type)
- g_variant_unref(v_attrs_type);
- if (v_attrs)
- g_variant_unref(v_attrs);
- if (v_access)
- g_variant_unref(v_access);
} else {
Z_LOGD("Discover attributes extended resp");
zigbee_zcl_global_control_emit_discover_attributes_extended_rsp(
attr_t->cluster_id, attr_t->list_count,
attr_t->node_id, attr_t->src_ep, attr_t->discovery_completed);
}
+ if (v_attrs_type)
+ g_variant_unref(v_attrs_type);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ if (v_access)
+ g_variant_unref(v_access);
break;
}
case ZBLIB_ZCL_GLOBAL_NOTI_DEFAULT_RSP: {
v_attrs = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
attr_t->attribute_list, (sizeof(gushort) * attr_t->list_count),
TRUE, NULL, NULL);
+ if (NULL == v_attrs) {
+ Z_LOGE("Failed to create variant!");
+ break;
+ }
v_data_type = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
attr_t->data_type_list, attr_t->list_count, TRUE, NULL, NULL);
- if (NULL == v_data_type || NULL == v_attrs) {
+ if (NULL == v_data_type) {
Z_LOGE("Failed to create variant!");
- if (v_data_type)
- g_variant_unref(v_data_type);
if (v_attrs)
g_variant_unref(v_attrs);
break;
values_builder = g_variant_builder_new(G_VARIANT_TYPE("a(y)"));
if (NULL == values_builder) {
Z_LOGE("Failed to create variant builder!");
- g_variant_unref(v_data_type);
- g_variant_unref(v_attrs);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ if (v_data_type)
+ g_variant_unref(v_data_type);
break;
}
for (i = 0; i < attr_t->list_count; i++) {
attr_t->node_id, attr_t->src_ep, attr_t->cluster_id,
v_attrs, v_data_type, v_values,
attr_t->list_count);
+ if (v_attrs)
+ g_variant_unref(v_attrs);
+ if (v_data_type)
+ g_variant_unref(v_data_type);
+ if (v_values)
+ g_variant_unref(v_values);
break;
}
case ZBLIB_ZCL_GLOBAL_NOTI_READ_CONFIG_REPORT_RSP: {
zigbee_zcl_global_control_emit_read_configure_reporting_rsp(
global_control_object, resp_t->node_id, resp_t->src_ep,
resp_t->cluster_id, resp_t->record_count, v_entries);
+
+ if (v_entries)
+ g_variant_unref(v_entries);
break;
}
default:
(sizeof(gushort) * nwk_addr_t->associated_count), TRUE, NULL, NULL);
if (NULL == v_eui64 || NULL == v_associated) {
Z_LOGE("Failed to create variant!");
- if (v_eui64)
- g_variant_unref(v_eui64);
- if (v_associated)
- g_variant_unref(v_associated);
} else {
Z_LOGD("nwk addr ext rsp : [0x%X]", nwk_addr_t->status);
zigbee_zdo_dev_control_emit_nwk_addr_ext_rsp(dev_control_object,
nwk_addr_t->status, v_eui64, nwk_addr_t->node_id,
nwk_addr_t->associated_count, nwk_addr_t->start_index, v_associated);
}
+ if (v_eui64)
+ g_variant_unref(v_eui64);
+ if (v_associated)
+ g_variant_unref(v_associated);
break;
}
case ZBLIB_ZDO_DEV_CONTROL_NOTI_ACTIVE_EP_RSP: {
active_t->status, active_t->node_id,
v_ep_list, active_t->endpoint_count);
}
+ if (v_ep_list)
+ g_variant_unref(v_ep_list);
break;
}
case ZBLIB_ZDO_DEV_CONTROL_NOTI_SIMPLE_DESC_RSP: {
TRUE, NULL, NULL);
if (NULL == v_in_cluster || NULL == v_out_cluster) {
Z_LOGE("Failed to create variant!");
- if (v_in_cluster)
- g_variant_unref(v_in_cluster);
- if (v_out_cluster)
- g_variant_unref(v_out_cluster);
} else {
Z_LOGD("Simple descriptor rsp");
zigbee_zdo_dev_control_emit_simple_desc_rsp(dev_control_object,
desc_t->in_cluster_count, desc_t->out_cluster_count,
v_in_cluster, v_out_cluster);
}
+ if (v_in_cluster)
+ g_variant_unref(v_in_cluster);
+ if (v_out_cluster)
+ g_variant_unref(v_out_cluster);
break;
}
case ZBLIB_ZDO_DEV_CONTROL_NOTI_MATCHED_DESC_RSP: {
zigbee_zdo_dev_control_emit_matched_descriptor_rsp(dev_control_object,
desc_t->status, desc_t->node_id, desc_t->list_count, v_match_list);
}
+ if (v_match_list)
+ g_variant_unref(v_match_list);
break;
}
case ZBLIB_ZDO_DEV_CONTROL_NOTI_MGMT_BIND_RSP: {
desc_t->status, desc_t->table_entries,
desc_t->start_index, desc_t->table_list_count,
v_entries);
+ if (v_entries)
+ g_variant_unref(v_entries);
break;
}
case ZBLIB_ZDO_DEV_CONTROL_NOTI_MGMT_LQI_RSP: {
nwk_disc_t->status, nwk_disc_t->network_count,
nwk_disc_t->start_index, nwk_disc_t->table_list_count,
v_entries);
+ if (v_entries)
+ g_variant_unref(v_entries);
break;
}
case ZBLIB_ZDO_DEV_CONTROL_NOTI_NODE_DESC_RSP: {
zigbee_zdo_dev_control_emit_user_desc_rsp(dev_control_object,
desc_t->status, desc_t->node_id, desc_t->list_count, v_desc_list);
}
+ if (v_desc_list)
+ g_variant_unref(v_desc_list);
break;
}
case ZBLIB_ZDO_DEV_CONTROL_NOTI_USER_DESC_CONFIRM: {