Skip to content

Commit

Permalink
Fix memory leak during host chart label cleanup (netdata#16568)
Browse files Browse the repository at this point in the history
Fix memory leak
  • Loading branch information
stelfrag committed Dec 8, 2023
1 parent 25f2abe commit 0d3c9be
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions database/sqlite/sqlite_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,12 +1474,11 @@ static void start_metadata_hosts(uv_work_t *req __maybe_unused)
char *machine_guid = *PValue;

host = rrdhost_find_by_guid(machine_guid);
if (unlikely(host))
continue;

uuid_t host_uuid;
if (!uuid_parse(machine_guid, host_uuid))
delete_host_chart_labels(&host_uuid);
if (likely(!host)) {
uuid_t host_uuid;
if (!uuid_parse(machine_guid, host_uuid))
delete_host_chart_labels(&host_uuid);
}

freez(machine_guid);
}
Expand Down

0 comments on commit 0d3c9be

Please sign in to comment.