Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input_metric: fixed a double free #8690

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/flb_input_metric.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@ static int input_metrics_append(struct flb_input_instance *ins,
if (out_context != NULL) {
/* Convert metrics to msgpack */
ret = cmt_encode_msgpack_create(out_context, &mt_buf, &mt_size);

if (out_context != cmt) {
cmt_destroy(out_context);
}

if (ret != 0) {
flb_plg_error(ins, "could not encode metrics");
cmt_destroy(out_context);

return -1;
}

cmt_destroy(out_context);
}
else {
/* Convert metrics to msgpack */
Expand Down
Loading