Skip to content

Commit

Permalink
out_stackdriver: fix leak on exception (CID 508239)
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Aug 9, 2024
1 parent e84d9ff commit f54b370
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/out_stackdriver/stackdriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ static flb_sds_t stackdriver_format(struct flb_stackdriver *ctx,

/* Parameters for trace */
int trace_extracted = FLB_FALSE;
flb_sds_t trace;
flb_sds_t trace = NULL;
char stackdriver_trace[PATH_MAX];
const char *new_trace;

Expand Down Expand Up @@ -2357,6 +2357,7 @@ static flb_sds_t stackdriver_format(struct flb_stackdriver *ctx,
flb_plg_error(ctx->ins, "the type of payload labels should be map");
flb_sds_destroy(operation_id);
flb_sds_destroy(operation_producer);
flb_sds_destroy(trace);
flb_log_event_decoder_destroy(&log_decoder);
msgpack_sbuffer_destroy(&mp_sbuf);
return NULL;
Expand Down

0 comments on commit f54b370

Please sign in to comment.