diff --git a/plugins/out_cloudwatch_logs/cloudwatch_logs.c b/plugins/out_cloudwatch_logs/cloudwatch_logs.c index f7273861dde..4a28d6f16ac 100644 --- a/plugins/out_cloudwatch_logs/cloudwatch_logs.c +++ b/plugins/out_cloudwatch_logs/cloudwatch_logs.c @@ -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; @@ -327,6 +327,7 @@ static int cb_cloudwatch_init(struct flb_output_instance *ins, return 0; error: + free(session_name); flb_plg_error(ctx->ins, "Initialization failed"); flb_cloudwatch_ctx_destroy(ctx); return -1;