Skip to content

Commit

Permalink
out_cloudwatch_logs: fix mem leak in init (CID 304902)
Browse files Browse the repository at this point in the history
Signed-off-by: Wesley Pettit <[email protected]>
  • Loading branch information
PettitWesley committed Jul 6, 2020
1 parent efd2c81 commit 3966090
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/out_cloudwatch_logs/cloudwatch_logs.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static int cb_cloudwatch_init(struct flb_output_instance *ins,
struct flb_config *config, void *data)
{
const char *tmp;
char *session_name;
char *session_name = NULL;
struct flb_cloudwatch *ctx = NULL;
struct cw_flush *buf = NULL;
int ret;
Expand Down Expand Up @@ -327,6 +327,7 @@ static int cb_cloudwatch_init(struct flb_output_instance *ins,
return 0;

error:
flb_free(session_name);
flb_plg_error(ctx->ins, "Initialization failed");
flb_cloudwatch_ctx_destroy(ctx);
return -1;
Expand Down

0 comments on commit 3966090

Please sign in to comment.