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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Oct 2019 14:45:10 +0000 (10:45 -0400)
commit8db97a2b3a0355ec5adb05460f2628d34f29344a
tree2f0188e100363194394bda0b17652ab42cf814a1
parent007231eb0431d45557a2fee586cf2c96c6afbee5
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.024408 seconds and 4 git commands to generate.