Cleanup: ctf-writer: field-wrapper.c: logically dead code
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 16 Sep 2019 15:24:50 +0000 (11:24 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 19 Sep 2019 18:41:48 +0000 (14:41 -0400)
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 <francis.deslauriers@efficios.com>
Change-Id: Ib468f8df4a11491b185ffa45c2db3bc4fc8fb045
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2051
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/ctf-writer/field-wrapper.c

index 2124d4ccbfad6ec6e214443414be2060a74fa75b..ee5234ab1791ddc0acdebe34dce9a39cf7a4ceaf 100644 (file)
@@ -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;
This page took 0.024612 seconds and 4 git commands to generate.