builder_for_in_devices = g_variant_builder_new(G_VARIANT_TYPE("au"));
builder_for_out_devices = g_variant_builder_new(G_VARIANT_TYPE("au"));
+ if (!builder_for_in_devices || !builder_for_out_devices) {
+ LOGE("failed to g_variant_builder_new(), builder_for_in_devices(%p), builder_for_out_devices(%p)",
+ builder_for_in_devices, builder_for_out_devices);
+ ret = MM_ERROR_SOUND_INTERNAL;
+ goto LEAVE;
+ }
for (i = 0; i < AVAIL_DEVICES_MAX; i++) {
if (!info->route_in_devices[i])
break;
info->is_set = true;
g_variant_unref(result);
- g_variant_builder_unref(builder_for_in_devices);
- g_variant_builder_unref(builder_for_out_devices);
LEAVE:
+ if (builder_for_in_devices)
+ g_variant_builder_unref(builder_for_in_devices);
+ if (builder_for_out_devices)
+ g_variant_builder_unref(builder_for_out_devices);
g_object_unref(conn);
return ret;