From: Francis Deslauriers Date: Mon, 16 Sep 2019 15:24:50 +0000 (-0400) Subject: Cleanup: ctf-writer: field-wrapper.c: logically dead code X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=a28452280defa290d884c80a88b05ce90cc5bfc7 Cleanup: ctf-writer: field-wrapper.c: logically dead code Coverity reported the following: CID 1401191 (#1 of 1): Logically dead code (DEADCODE)dead_error_begin: Execution cannot reach this statement: bt_ctf_field_wrapper_destroy. Reported-by: Coverity - 1401191 Logically dead code (DEADCODE) Signed-off-by: Francis Deslauriers Change-Id: Ib468f8df4a11491b185ffa45c2db3bc4fc8fb045 Reviewed-on: https://review.lttng.org/c/babeltrace/+/2051 Tested-by: jenkins Reviewed-by: Simon Marchi --- diff --git a/src/ctf-writer/field-wrapper.c b/src/ctf-writer/field-wrapper.c index 2124d4cc..ee5234ab 100644 --- a/src/ctf-writer/field-wrapper.c +++ b/src/ctf-writer/field-wrapper.c @@ -70,17 +70,10 @@ struct bt_ctf_field_wrapper *bt_ctf_field_wrapper_create( field_wrapper = bt_ctf_object_pool_create_object(pool); if (!field_wrapper) { BT_LOGE("Cannot allocate one field wrapper"); - goto error; + goto end; } BT_ASSERT(field_wrapper->field); - goto end; - -error: - if (field_wrapper) { - bt_ctf_field_wrapper_destroy(field_wrapper); - field_wrapper = NULL; - } end: return field_wrapper;