diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-08-22 16:11:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-22 16:11:16 +0300 |
commit | c414aca77ab8f83fba9f8b22fa2c6448b5a5a5e4 (patch) | |
tree | 70c87c84e4be1e61f07ca3ed00f23e6b75317331 /database/rrdcalc.c | |
parent | 243d7f9bbe81e5463ea65f15cc6288b792c54ab8 (diff) |
Fix coverity 380387 (#13551)
check rc->rrdset
Diffstat (limited to 'database/rrdcalc.c')
-rw-r--r-- | database/rrdcalc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/database/rrdcalc.c b/database/rrdcalc.c index ef0a918b03..39fb09681a 100644 --- a/database/rrdcalc.c +++ b/database/rrdcalc.c @@ -64,7 +64,7 @@ char *rrdcalc_replace_variables(const char *line, RRDCALC *rc) freez(temp); temp = buf; } else if (!strncmp(var, RRDCALC_VAR_LABEL, RRDCALC_VAR_LABEL_LEN)) { - if(likely(rc->rrdset->state && rc->rrdset->state->chart_labels)) { + if(likely(rc->rrdset && rc->rrdset->state && rc->rrdset->state->chart_labels)) { rrdlabels_get_value_to_char_or_null(rc->rrdset->state->chart_labels, &lbl_value, var+RRDCALC_VAR_LABEL_LEN); if (lbl_value) { char *buf = find_and_replace(temp, var, lbl_value, m); |