diff --git a/plugins/out_stackdriver/stackdriver.c b/plugins/out_stackdriver/stackdriver.c index 60b66c48ce4..afcf15fe327 100644 --- a/plugins/out_stackdriver/stackdriver.c +++ b/plugins/out_stackdriver/stackdriver.c @@ -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; @@ -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;