@@ -813,6 +813,7 @@ struct flb_output_flush *flb_output_flush_create(struct flb_task *task,
813
813
evc -> size ,
814
814
& chunk_offset )) == CMT_DECODE_MSGPACK_SUCCESS ) {
815
815
816
+ cmt_out_context = NULL ;
816
817
ret = flb_processor_run (o_ins -> processor ,
817
818
0 ,
818
819
FLB_PROCESSOR_METRICS ,
@@ -831,7 +832,7 @@ struct flb_output_flush *flb_output_flush_create(struct flb_task *task,
831
832
encode_context = metrics_context ;
832
833
}
833
834
834
- /* if the cmetrics context lack of time series just skip it */
835
+ /* if the cmetrics context lacks time series just skip it */
835
836
if (flb_metrics_is_empty (encode_context )) {
836
837
if (encode_context != metrics_context ) {
837
838
cmt_destroy (encode_context );
@@ -887,6 +888,16 @@ struct flb_output_flush *flb_output_flush_create(struct flb_task *task,
887
888
888
889
cmt_encode_msgpack_destroy (serialized_context_buffer );
889
890
}
891
+ else {
892
+ cmt_destroy (metrics_context );
893
+ if (cmt_out_context != NULL && cmt_out_context != metrics_context ) {
894
+ cmt_destroy (cmt_out_context );
895
+ }
896
+ flb_coro_destroy (coro );
897
+ flb_free (out_flush );
898
+ flb_free (p_buf );
899
+ return NULL ;
900
+ }
890
901
}
891
902
892
903
if (serialization_buffer_offset == 0 ) {
@@ -904,6 +915,7 @@ struct flb_output_flush *flb_output_flush_create(struct flb_task *task,
904
915
0 );
905
916
}
906
917
else {
918
+ p_size = serialization_buffer_offset ;
907
919
out_flush -> processed_event_chunk = flb_event_chunk_create (
908
920
evc -> type ,
909
921
0 ,
0 commit comments