From 72e26055629d323a4926b169e441bba9cf1edefa Mon Sep 17 00:00:00 2001 From: Paul Kramer <47924093+paulkram@users.noreply.github.com> Date: Fri, 9 Dec 2022 03:04:28 +0100 Subject: [PATCH] bugfix: fix broken type label of turn_total_allocations gauge (#1119) It's not working when constructing it in-place, likely this is undefined behaviour. Co-authored-by: Paul Kramer --- src/apps/relay/prom_server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apps/relay/prom_server.c b/src/apps/relay/prom_server.c index a245f08..eb945ba 100644 --- a/src/apps/relay/prom_server.c +++ b/src/apps/relay/prom_server.c @@ -147,13 +147,15 @@ void prom_set_finished_traffic(const char *realm, const char *user, unsigned lon void prom_inc_allocation(SOCKET_TYPE type) { if (turn_params.prometheus == 1) { - prom_gauge_inc(turn_total_allocations, (const char *[]){socket_type_name(type)}); + const char *label[] = {socket_type_name(type)}; + prom_gauge_inc(turn_total_allocations, label); } } void prom_dec_allocation(SOCKET_TYPE type) { if (turn_params.prometheus == 1) { - prom_gauge_dec(turn_total_allocations, (const char *[]){socket_type_name(type)}); + const char *label[] = {socket_type_name(type)}; + prom_gauge_dec(turn_total_allocations, label); } }