bt_object_init_unique(&ret->base);
ret->clock_class = clock_class;
- bt_object_get_no_null_check(clock_class);
+ bt_object_get_ref_no_null_check(clock_class);
bt_clock_class_freeze(clock_class);
BT_LIB_LOGD("Created clock snapshot object: %!+k", ret);
BT_LIB_LOGE_APPEND_CAUSE(
"Cannot allocate one clock snapshot from clock class's clock snapshot pool: "
"%![cc-]+K", clock_class);
- goto error;
+ goto end;
}
if (G_LIKELY(!clock_snapshot->clock_class)) {
clock_snapshot->clock_class = clock_class;
- bt_object_get_no_null_check(clock_class);
- }
-
- goto end;
-
-error:
- if (clock_snapshot) {
- bt_clock_snapshot_recycle(clock_snapshot);
- clock_snapshot = NULL;
+ bt_object_get_ref_no_null_check(clock_class);
}
end:
"Clock snapshot, once converted to nanoseconds from origin, "
"overflows the signed 64-bit integer range: "
"%![cs-]+k", clock_snapshot);
- ret = BT_FUNC_STATUS_OVERFLOW;
+ ret = BT_FUNC_STATUS_OVERFLOW_ERROR;
goto end;
}