Fix: sink.utils.counter: possible NULL pointer dereference
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 20 Aug 2019 03:33:12 +0000 (23:33 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 23 Aug 2019 00:44:13 +0000 (20:44 -0400)
commit718c4b7ca1d368514d0e0de5bf71b30cdf05473b
tree892319a8a03ee45a890df7315e556c1ba309eaf0
parentc6eb0200b98c69231070be9ba2e750603275504d
Fix: sink.utils.counter: possible NULL pointer dereference

If the null check at line 148 is true, the `counter` pointer might be
used will be used while being NULL by the
`destroy_private_counter_data()` function.

scan-build report:
  Access to field 'msg_iter' results in a dereference of a null pointer
  (loaded from variable 'counter')

Reported-by: scan-build - Logic error Dereference of null pointer
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I50bb981433ef3f5083613b36bbef54743cddb4c2
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1970
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/plugins/utils/counter/counter.c
This page took 0.025501 seconds and 4 git commands to generate.