Fix: object-pool.c: dereferenced before null check
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 16 Sep 2019 16:03:46 +0000 (12:03 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 19 Sep 2019 18:41:05 +0000 (14:41 -0400)
commit701406be55cacd418346a3ff1aca17b549c186a7
tree975a9f440e16346e252362fd13cfaf9165c45592
parent508b9546463484f40ffc524d0b64923e464b672c
Fix: object-pool.c: dereferenced before null check

Coverity reported the following:
  CID 1401187 (#1 of 1): Dereference before null check
  (REVERSE_INULL)check_after_deref: Null-checking pool suggests that it
  may be null, but it has already been dereferenced on all paths leading
  to the check.

Add a `BT_ASSERT()` to ensure that `pool` is not null.

Reported-by: Coverity - 1401187 Dereference before null check (REVERSE_INULL)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Ie18fecdad17c1a42db914d2eb987f783a4523871
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2054
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/lib/object-pool.c
This page took 0.025915 seconds and 4 git commands to generate.