diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index 80b61020bec..156c4181ecc 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -162,6 +162,11 @@ StartupDecodingContext(List *output_plugin_options, ctx->slot = slot; ctx->reader = XLogReaderAllocate(read_page, ctx); + if (!ctx->reader) + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of memory"))); + ctx->reader->private_data = ctx; ctx->reorder = ReorderBufferAllocate();