py-common: clean-up: unreachable error handling code
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 28 Feb 2020 23:54:55 +0000 (18:54 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Sat, 29 Feb 2020 23:31:28 +0000 (18:31 -0500)
commit87694a583f967f4b8e9e7b232805e93bdc0e6089
treee438bc52103314214bd671a7adeb501ec3d8564c
parent38c609ff3f2dc76788cc9bf5fc8b32d3a3b692f6
py-common: clean-up: unreachable error handling code

Both `bt_py_common_format_exception()` and `bt_py_common_format_tb()`
use the same error handling pattern of defining an `error` label and
free-ing `msg_buf` if it has been created before jumping there.

In both cases, the creation of `msg_buf` is the last operation that
can fail, which makes the check, and clean-up, unrechable.

From Coverity's report:
1408326 Logically dead code

The indicated dead code may have performed some action; that action
will never occur.

In bt_py_common_format_tb: Code can never be reached because of a
logical contradiction (CWE-561)

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I81b5a2db2cefe1fe08e25819bfa2d8e0fd78ee82
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3154
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/py-common/py-common.c
This page took 0.024549 seconds and 4 git commands to generate.