Skip to content

Commit

Permalink
Auto-Merge pull request collectd#4285 from octo/6/write_prometheus_lock
Browse files Browse the repository at this point in the history
Automatically merged due to "Automerge" label
  • Loading branch information
collectd-bot authored Feb 20, 2024
2 parents 49c9dd8 + 73eff54 commit 974c4e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/write_prometheus.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,10 @@ static int prom_missing(metric_family_t const *fam,
pthread_mutex_lock(&prom_metrics_lock);

metric_family_t *prom_fam = NULL;
if (c_avl_get(prom_metrics, fam->name, (void *)&prom_fam) != 0)
if (c_avl_get(prom_metrics, fam->name, (void *)&prom_fam) != 0) {
pthread_mutex_unlock(&prom_metrics_lock);
return 0;
}

for (size_t i = 0; i < fam->metric.num; i++) {
metric_t const *m = &fam->metric.ptr[i];
Expand Down

0 comments on commit 974c4e1

Please sign in to comment.