Skip to content

Commit 8bee4e5

Browse files
nokute78root
authored andcommitted
out_forward: release buf when no connection available and time_as_integer is true (fluent#6082)
Signed-off-by: Takahiro Yamashita <[email protected]> Signed-off-by: root <[email protected]>
1 parent f0ca5e5 commit 8bee4e5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

plugins/out_forward/forward.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,6 @@ static void cb_forward_flush(struct flb_event_chunk *event_chunk,
12541254
int mode;
12551255
msgpack_packer mp_pck;
12561256
msgpack_sbuffer mp_sbuf;
1257-
void *tmp_buf = NULL;
12581257
void *out_buf = NULL;
12591258
size_t out_size = 0;
12601259
struct flb_forward *ctx = out_context;
@@ -1309,7 +1308,7 @@ static void cb_forward_flush(struct flb_event_chunk *event_chunk,
13091308
flb_plg_error(ctx->ins, "no upstream connections available");
13101309
msgpack_sbuffer_destroy(&mp_sbuf);
13111310
if (fc->time_as_integer == FLB_TRUE) {
1312-
flb_free(tmp_buf);
1311+
flb_free(out_buf);
13131312
}
13141313
flb_free(flush_ctx);
13151314
FLB_OUTPUT_RETURN(FLB_RETRY);
@@ -1328,7 +1327,7 @@ static void cb_forward_flush(struct flb_event_chunk *event_chunk,
13281327
}
13291328
msgpack_sbuffer_destroy(&mp_sbuf);
13301329
if (fc->time_as_integer == FLB_TRUE) {
1331-
flb_free(tmp_buf);
1330+
flb_free(out_buf);
13321331
}
13331332
flb_free(flush_ctx);
13341333
FLB_OUTPUT_RETURN(FLB_RETRY);

0 commit comments

Comments
 (0)