Skip to content

Commit

Permalink
Add needed lock/unlock to access t->inst->list (CID 1551705)
Browse files Browse the repository at this point in the history
  • Loading branch information
jejones3141 committed Jan 22, 2024
1 parent 252dca9 commit 6d4c671
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/rlm_stats/rlm_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static void coalesce(uint64_t final_stats[FR_RADIUS_CODE_MAX], rlm_stats_thread_
* Loop over all of the other thread instances, locking
* them, and adding their statistics in.
*/
pthread_mutex_lock(&t->mutex);
for (other = fr_dlist_head(&t->inst->list);
other != NULL;
other = fr_dlist_next(&t->inst->list, other)) {
Expand All @@ -153,6 +154,7 @@ static void coalesce(uint64_t final_stats[FR_RADIUS_CODE_MAX], rlm_stats_thread_

pthread_mutex_unlock(&other->mutex);
}
pthread_mutex_unlock(&t->mutex);
}


Expand Down

0 comments on commit 6d4c671

Please sign in to comment.