Skip to content

Commit

Permalink
out_forward: release buf when no connection available and time_as_int…
Browse files Browse the repository at this point in the history
…eger is true (fluent#6082)

Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 committed Oct 15, 2022
1 parent 82c9d0e commit 6050e85
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/out_forward/forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,6 @@ static void cb_forward_flush(struct flb_event_chunk *event_chunk,
int mode;
msgpack_packer mp_pck;
msgpack_sbuffer mp_sbuf;
void *tmp_buf = NULL;
void *out_buf = NULL;
size_t out_size = 0;
struct flb_forward *ctx = out_context;
Expand Down Expand Up @@ -1285,7 +1284,7 @@ static void cb_forward_flush(struct flb_event_chunk *event_chunk,
flb_plg_error(ctx->ins, "no upstream connections available");
msgpack_sbuffer_destroy(&mp_sbuf);
if (fc->time_as_integer == FLB_TRUE) {
flb_free(tmp_buf);
flb_free(out_buf);
}
flb_free(flush_ctx);
FLB_OUTPUT_RETURN(FLB_RETRY);
Expand All @@ -1304,7 +1303,7 @@ static void cb_forward_flush(struct flb_event_chunk *event_chunk,
}
msgpack_sbuffer_destroy(&mp_sbuf);
if (fc->time_as_integer == FLB_TRUE) {
flb_free(tmp_buf);
flb_free(out_buf);
}
flb_free(flush_ctx);
FLB_OUTPUT_RETURN(FLB_RETRY);
Expand Down

0 comments on commit 6050e85

Please sign in to comment.