table plugin: Assert that result_num is zero when result is NULL.
authorFlorian Forster <octo@collectd.org>
Mon, 20 Nov 2017 13:19:46 +0000 (14:19 +0100)
committerFlorian Forster <octo@collectd.org>
Mon, 20 Nov 2017 13:19:46 +0000 (14:19 +0100)
commitdfe33d435b2c29f7376507463700c5d4d07f3dfa
tree4cd83c6d5c04e14494b24a4e7d87fccb20ce3274
parent4587f88e51545d383aa759109ed6cd1ed851fe13
table plugin: Assert that result_num is zero when result is NULL.

The Coverity check gets confused by the `tbl->results == NULL` check:
due to the check, is assumes that tbl->results *may* be NULL. It then
discovers the dereference in tbl_clear() without realizing that "result"
and "result_num" are linked and that situation can't happen. This
assertion makes this link a bit easier to conclude.

CID: 37966
src/table.c