- BT_PUT(component);
- goto end;
- }
-
- if (type == BT_COMPONENT_CLASS_TYPE_SOURCE ||
- type == BT_COMPONENT_CLASS_TYPE_FILTER) {
- default_port = bt_component_add_port(component,
- component->output_ports, BT_PORT_TYPE_OUTPUT,
- DEFAULT_OUTPUT_PORT_NAME);
- if (!default_port) {
- BT_PUT(component);
- goto end;
- }
-
- BT_PUT(default_port);
- }
-
- if (type == BT_COMPONENT_CLASS_TYPE_FILTER ||
- type == BT_COMPONENT_CLASS_TYPE_SINK) {
- default_port = bt_component_add_port(component,
- component->input_ports, BT_PORT_TYPE_INPUT,
- DEFAULT_INPUT_PORT_NAME);
- if (!default_port) {
- BT_PUT(component);
- goto end;
- }
-
- BT_PUT(default_port);
- }
-
- component->initializing = true;
-
- if (component_class->methods.init) {
- ret = component_class->methods.init(
- bt_private_component_from_component(component), params,
- init_method_data);
- component->initializing = false;
- if (ret != BT_COMPONENT_STATUS_OK) {
- BT_PUT(component);
- goto end;
- }
- }
-
- component->initializing = false;
- ret = component_validation_funcs[type](component);
- if (ret != BT_COMPONENT_STATUS_OK) {
- BT_PUT(component);