Fix agent crash when executing data query with context and non-existing chart_label_key (#10844)
Stelios Fragkakis committed
Mar 24, 2021 at 11:30 UTC
c527863c5327123a43047bb61e7fdf5325177cbd
1 file changed
+4
-2
web/api/web_api_v1.c
+4
-2
@@ -511,8 +511,10 @@ inline int web_client_api_request_v1_data(RRDHOST *host, struct web_client *w, c
511
rrdhost_unlock(host);
512
if (likely(context_param_list && context_param_list->rd)) // Just set the first one
513
st = context_param_list->rd->rrdset;
514
- else
515
- sql_build_context_param_list(&context_param_list, host, context, NULL);
514
+ else {
515
+ if (!chart_label_key)
516
+ sql_build_context_param_list(&context_param_list, host, context, NULL);
517
+ }
518
}
519
else {
520
st = rrdset_find(host, chart);