Skip to content

Commit

Permalink
Improved query target cleanup (netdata#17038)
Browse files Browse the repository at this point in the history
Clear smh to avoid possible double metric release
  • Loading branch information
stelfrag authored Feb 20, 2024
1 parent 58464f5 commit e1eca05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/database/contexts/query_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,10 @@ static bool query_metric_add(QUERY_TARGET_LOCALS *qtl, QUERY_NODE *qn, QUERY_CON

// cleanup anything we allocated to the retention we will not use
for(size_t tier = 0; tier < storage_tiers ;tier++) {
if (tier_retention[tier].smh)
if (tier_retention[tier].smh) {
tier_retention[tier].eng->api.metric_release(tier_retention[tier].smh);
tier_retention[tier].smh = NULL;
}
}

return false;
Expand Down

0 comments on commit e1eca05

Please sign in to comment.