From dfe33d435b2c29f7376507463700c5d4d07f3dfa Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 20 Nov 2017 14:19:46 +0100 Subject: [PATCH] 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/table.c b/src/table.c index 3e8feada..cebcaed0 100644 --- a/src/table.c +++ b/src/table.c @@ -279,6 +279,7 @@ static int tbl_config_table(oconfig_item_t *ci) { } if (NULL == tbl->results) { + assert(tbl->results_num == 0); log_err("Table \"%s\" does not specify any (valid) results.", tbl->file); status = 1; } -- 2.11.0