Coverity warns of logically dead code in error.c:
1506395 Logically dead code
The indicated dead code may have performed some action; that action will never occur.
In bt_error_append_cause_from_component_class: Code can never be reached because of a logical contradiction (CWE-561)
`cause` is indeed always NULL at the `end` label since it either failed
to be allocated or its ownership was transferred to the `causes` array.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie1c746b9fe6d6202cd6c3baaef39516a5e902471
Reviewed-on: https://review.lttng.org/c/babeltrace/+/9614
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
cause = NULL;
end:
- destroy_error_cause(cause);
return status;
}
cause = NULL;
end:
- if (cause) {
- destroy_error_cause(&cause->base);
- }
-
return status;
}
cause = NULL;
end:
- if (cause) {
- destroy_error_cause(&cause->base);
- }
-
return status;
}
cause = NULL;
end:
- if (cause) {
- destroy_error_cause(&cause->base);
- }
-
return status;
}