diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index a09ef75ac37..fb72d16c113 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -8594,7 +8594,7 @@ heap_xlog_prune_freeze(XLogReaderState *record)
 {
 	XLogRecPtr	lsn = record->EndRecPtr;
 	char	   *ptr;
-	xl_heap_prune *xlrec;
+	xl_heap_prune xlrec;
 	Buffer		buffer;
 	RelFileLocator rlocator;
 	BlockNumber blkno;
@@ -8602,8 +8602,7 @@ heap_xlog_prune_freeze(XLogReaderState *record)
 
 	XLogRecGetBlockTag(record, 0, &rlocator, NULL, &blkno);
 	ptr = XLogRecGetData(record);
-	xlrec = (xl_heap_prune *) ptr;
-	ptr += SizeOfHeapPrune;
+	memcpy(&xlrec, ptr, SizeOfHeapPrune);
 
 	/*
 	 * We will take an ordinary exclusive lock or a cleanup lock depending on
@@ -8611,22 +8610,24 @@ heap_xlog_prune_freeze(XLogReaderState *record)
 	 * lock, we better not be doing anything that requires moving existing
 	 * tuple data.
 	 */
-	Assert((xlrec->flags & XLHP_CLEANUP_LOCK) != 0 ||
-		   (xlrec->flags & (XLHP_HAS_REDIRECTIONS | XLHP_HAS_DEAD_ITEMS)) == 0);
+	Assert((xlrec.flags & XLHP_CLEANUP_LOCK) != 0 ||
+		   (xlrec.flags & (XLHP_HAS_REDIRECTIONS | XLHP_HAS_DEAD_ITEMS)) == 0);
 
 	/*
 	 * We are about to remove and/or freeze tuples.  In Hot Standby mode,
 	 * ensure that there are no queries running for which the removed tuples
 	 * are still visible or which still consider the frozen xids as running.
 	 * The conflict horizon XID comes after xl_heap_prune.
+	 * TODO: comment about deserialization conditions differing
 	 */
-	if (InHotStandby && (xlrec->flags & XLHP_HAS_CONFLICT_HORIZON) != 0)
+	if (InHotStandby && (xlrec.flags & XLHP_HAS_CONFLICT_HORIZON) != 0)
 	{
 		TransactionId snapshot_conflict_horizon;
 
-		memcpy(&snapshot_conflict_horizon, ptr, sizeof(TransactionId));
+		// TODO: comment about unaligned so must memcpy
+		memcpy(&snapshot_conflict_horizon, ptr + SizeOfHeapPrune, sizeof(TransactionId));
 		ResolveRecoveryConflictWithSnapshot(snapshot_conflict_horizon,
-											(xlrec->flags & XLHP_IS_CATALOG_REL) != 0,
+											(xlrec.flags & XLHP_IS_CATALOG_REL) != 0,
 											rlocator);
 	}
 
@@ -8634,7 +8635,7 @@ heap_xlog_prune_freeze(XLogReaderState *record)
 	 * If we have a full-page image, restore it and we're done.
 	 */
 	action = XLogReadBufferForRedoExtended(record, 0, RBM_NORMAL,
-										   (xlrec->flags & XLHP_CLEANUP_LOCK) != 0,
+										   (xlrec.flags & XLHP_CLEANUP_LOCK) != 0,
 										   &buffer);
 	if (action == BLK_NEEDS_REDO)
 	{
@@ -8651,7 +8652,7 @@ heap_xlog_prune_freeze(XLogReaderState *record)
 		OffsetNumber *frz_offsets;
 		char	   *dataptr = XLogRecGetBlockData(record, 0, &datalen);
 
-		heap_xlog_deserialize_prune_and_freeze(dataptr, xlrec->flags,
+		heap_xlog_deserialize_prune_and_freeze(dataptr, xlrec.flags,
 											   &nredirected, &redirected,
 											   &ndead, &nowdead,
 											   &nunused, &nowunused,
@@ -8663,7 +8664,7 @@ heap_xlog_prune_freeze(XLogReaderState *record)
 		 */
 		if (nredirected > 0 || ndead > 0 || nunused > 0)
 			heap_page_prune_execute(buffer,
-									(xlrec->flags & XLHP_CLEANUP_LOCK) == 0,
+									(xlrec.flags & XLHP_CLEANUP_LOCK) == 0,
 									redirected, nredirected,
 									nowdead, ndead,
 									nowunused, nunused);
@@ -8715,7 +8716,7 @@ heap_xlog_prune_freeze(XLogReaderState *record)
 	 */
 	if (BufferIsValid(buffer))
 	{
-		if (xlrec->flags & (XLHP_HAS_REDIRECTIONS |
+		if (xlrec.flags & (XLHP_HAS_REDIRECTIONS |
 							XLHP_HAS_DEAD_ITEMS |
 							XLHP_HAS_NOW_UNUSED_ITEMS))
 		{
