Release label key if already in use (#16916)
Release key_match if found
Stelios Fragkakis committed
Feb 5, 2024 at 10:23 UTC
c5579a186f22aba0edd7da844c6186c688625e3c
1 file changed
+3
-1
src/database/contexts/query_target.c
+3
-1
@@ -1072,8 +1072,10 @@ static void add_label_pattern(struct label_pattern_list *lpl, char *label_key_va
1072
1073
lpl->buffer_list[index] = buffer_create(128, NULL);
1074
lpl->key[index] = key_match;
1075
- } else
1075
+ } else {
1076
+ string_freez(key_match);
1077
buffer_strncat(lpl->buffer_list[index], ",", 1);
1078
+ }
1079
1080
buffer_strcat(lpl->buffer_list[index], label_key_value);
1081
}