summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2021-03-24 11:30:43 +0200
committerGitHub <noreply@github.com>2021-03-24 11:30:43 +0200
commitc527863c5327123a43047bb61e7fdf5325177cbd (patch)
tree1897e7412c1bb5ce79d10728501af181568889b5
parent1fc4dbbbc8948bbba63a98f30119f99331e97df8 (diff)
Fix agent crash when executing data query with context and non-existing chart_label_key (#10844)
-rw-r--r--web/api/web_api_v1.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c
index 72962f9b10..0d2a33538a 100644
--- a/web/api/web_api_v1.c
+++ b/web/api/web_api_v1.c
@@ -511,8 +511,10 @@ inline int web_client_api_request_v1_data(RRDHOST *host, struct web_client *w, c
rrdhost_unlock(host);
if (likely(context_param_list && context_param_list->rd)) // Just set the first one
st = context_param_list->rd->rrdset;
- else
- sql_build_context_param_list(&context_param_list, host, context, NULL);
+ else {
+ if (!chart_label_key)
+ sql_build_context_param_list(&context_param_list, host, context, NULL);
+ }
}
else {
st = rrdset_find(host, chart);