Skip to content

Commit

Permalink
out_gelf: fix releasing function handling (#7640)
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored Jul 3, 2023
1 parent b8d898d commit bf28ed4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions plugins/out_gelf/gelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ static void cb_gelf_flush(struct flb_event_chunk *event_chunk,
int ret;
flb_sds_t s;
flb_sds_t tmp;
msgpack_unpacked result;
size_t off = 0;
size_t prev_off = 0;
size_t size = 0;
Expand Down Expand Up @@ -271,8 +270,6 @@ static void cb_gelf_flush(struct flb_event_chunk *event_chunk,
FLB_OUTPUT_RETURN(FLB_RETRY);
}

msgpack_unpacked_init(&result);

while ((ret = flb_log_event_decoder_next(
&log_decoder,
&log_event)) == FLB_EVENT_DECODER_SUCCESS) {
Expand All @@ -285,7 +282,7 @@ static void cb_gelf_flush(struct flb_event_chunk *event_chunk,
size = (size * 1.4);
s = flb_sds_create_size(size);
if (s == NULL) {
msgpack_unpacked_destroy(&result);
flb_log_event_decoder_destroy(&log_decoder);
FLB_OUTPUT_RETURN(FLB_ERROR);
}

Expand Down Expand Up @@ -333,7 +330,7 @@ static void cb_gelf_flush(struct flb_event_chunk *event_chunk,
flb_sds_destroy(s);
}

msgpack_unpacked_destroy(&result);
flb_log_event_decoder_destroy(&log_decoder);

if (ctx->mode != FLB_GELF_UDP) {
flb_upstream_conn_release(u_conn);
Expand Down

0 comments on commit bf28ed4

Please sign in to comment.