Skip to content

Commit 60d6180

Browse files
committed
out_es: fix possible memory leak
Used cleanup procedure for 'out_buf' and 'result' for the case when errors of JSON parsing occurred. Signed-off-by: Castor Sky <csky57@gmail.com>
1 parent 285c300 commit 60d6180

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/out_es/es.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ static int elasticsearch_error_check(struct flb_elasticsearch *ctx,
702702
flb_plg_error(ctx->ins, "Cannot unpack response to find error\n%s",
703703
c->resp.payload);
704704
check |= FLB_ES_STATUS_ERROR_UNPACK;
705-
return check;
705+
goto done;
706706
}
707707

708708
root = result.data;

0 commit comments

Comments
 (0)