static void report_invalid_record(XLogReaderState *state, const char *fmt,...)
                        pg_attribute_printf(2, 3);
-static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
+static void allocate_recordbuf(XLogReaderState *state, uint32 reclength);
 static int     ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
                                                         int reqLen);
 static void XLogReaderInvalReadState(XLogReaderState *state);
         * Allocate an initial readRecordBuf of minimal size, which can later be
         * enlarged if necessary.
         */
-       if (!allocate_recordbuf(state, 0))
-       {
-               pfree(state->errormsg_buf);
-               pfree(state->readBuf);
-               pfree(state);
-               return NULL;
-       }
-
+       allocate_recordbuf(state, 0);
        return state;
 }
 
 
 /*
  * Allocate readRecordBuf to fit a record of at least the given length.
- * Returns true if successful, false if out of memory.
  *
  * readRecordBufSize is set to the new buffer size.
  *
  * Note: This routine should *never* be called for xl_tot_len until the header
  * of the record has been fully validated.
  */
-static bool
+static void
 allocate_recordbuf(XLogReaderState *state, uint32 reclength)
 {
        uint32          newSize = reclength;
 
        if (state->readRecordBuf)
                pfree(state->readRecordBuf);
-       state->readRecordBuf =
-               (char *) palloc_extended(newSize, MCXT_ALLOC_NO_OOM);
-       if (state->readRecordBuf == NULL)
-       {
-               state->readRecordBufSize = 0;
-               return false;
-       }
+       state->readRecordBuf = (char *) palloc(newSize);
        state->readRecordBufSize = newSize;
-       return true;
 }
 
 /*
        /* Not enough space in the decode buffer.  Are we allowed to allocate? */
        if (allow_oversized)
        {
-               decoded = palloc_extended(required_space, MCXT_ALLOC_NO_OOM);
-               if (decoded == NULL)
-                       return NULL;
+               decoded = palloc(required_space);
                decoded->oversized = true;
                return decoded;
        }
                                Assert(gotlen <= lengthof(save_copy));
                                Assert(gotlen <= state->readRecordBufSize);
                                memcpy(save_copy, state->readRecordBuf, gotlen);
-                               if (!allocate_recordbuf(state, total_len))
-                               {
-                                       /* We treat this as a "bogus data" condition */
-                                       report_invalid_record(state, "record length %u at %X/%X too long",
-                                                                                 total_len, LSN_FORMAT_ARGS(RecPtr));
-                                       goto err;
-                               }
+                               allocate_recordbuf(state, total_len);
                                memcpy(state->readRecordBuf, save_copy, gotlen);
                                buffer = state->readRecordBuf + gotlen;
                        }
                decoded = XLogReadRecordAlloc(state,
                                                                          total_len,
                                                                          true /* allow_oversized */ );
-               if (decoded == NULL)
-               {
-                       /*
-                        * We failed to allocate memory for an oversized record.  As
-                        * above, we currently treat this as a "bogus data" condition.
-                        */
-                       report_invalid_record(state,
-                                                                 "out of memory while trying to decode a record of length %u", total_len);
-                       goto err;
-               }
+               /* allocation should always happen under allow_oversized */
+               Assert(decoded != NULL);
        }
 
        if (DecodeXLogRecord(state, decoded, record, RecPtr, &errormsg))