Skip to content

Commit ec2cd6c

Browse files
committed
out_opensearch: 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 b7bee7f commit ec2cd6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/out_opensearch/opensearch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ static int opensearch_error_check(struct flb_opensearch *ctx,
760760
flb_plg_error(ctx->ins, "Cannot unpack response to find error\n%s",
761761
c->resp.payload);
762762
check |= FLB_OS_STATUS_ERROR_UNPACK;
763-
return check;
763+
goto done;
764764
}
765765

766766
root = result.data;

0 commit comments

Comments
 (0)