Fix: ctf-writer: stream-class.c: Dereference after null check
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 16 Sep 2019 14:54:45 +0000 (10:54 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 19 Sep 2019 18:41:40 +0000 (14:41 -0400)
Coverity reported the following:
  CID 1401231 (#1 of 1): Dereference after null check (FORWARD_NULL)8.
  var_deref_model: Passing null pointer ft_copy to
  bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen,
  which dereferences it

Reported-by: Coverity - 1401231 Dereference after null check (FORWARD_NULL)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I32a15f0ff927c8b987e785a37596e9c56b628de5
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2049
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/ctf-writer/stream-class.c

index ac3db47a1ff430fa71e461f8753417e1945af3d8..2d3b2fbae70e51448d51304196a82e0eec19e56c 100644 (file)
@@ -776,6 +776,8 @@ int try_map_clock_class(struct bt_ctf_stream_class *stream_class,
                if (!ft_copy) {
                        BT_LOGE("Failed to copy integer field type: ft-addr=%p",
                                ft);
+                       ret = -1;
+                       goto end;
                }
 
                ret = bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
This page took 0.02486 seconds and 4 git commands to generate.