Skip to content

Commit

Permalink
fix: memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bezannier <[email protected]>
  • Loading branch information
flobz committed Nov 14, 2022
1 parent 9cdbfe7 commit a7dace2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/out_opentelemetry/opentelemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ static int http_post(struct opentelemetry_context *ctx,
out_ret = FLB_RETRY;
}

/*
* If the payload buffer is different than incoming records in body, means
* we generated a different payload and must be freed.
*/
if (final_body != body) {
flb_free(final_body);
}
/* Destroy HTTP client context */
flb_http_client_destroy(c);

Expand Down

0 comments on commit a7dace2

Please sign in to comment.