diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c
index a92b4541bd..841d88df76 100644
--- a/src/backend/utils/mmgr/portalmem.c
+++ b/src/backend/utils/mmgr/portalmem.c
@@ -798,8 +798,6 @@ AtAbort_Portals(void)
 		 * cursor from a previous transaction, but it could also be that the
 		 * cursor was auto-held in this transaction, so it wants to live on.
 		 */
-		if (portal->autoHeld)
-			continue;
 
 		/*
 		 * If it was created in the current transaction, we can't do normal
@@ -868,7 +866,7 @@ AtCleanup_Portals(void)
 		 * Do nothing to cursors held over from a previous transaction or
 		 * auto-held ones.
 		 */
-		if (portal->createSubid == InvalidSubTransactionId || portal->autoHeld)
+		if (portal->createSubid == InvalidSubTransactionId)
 		{
 			Assert(portal->status != PORTAL_ACTIVE);
 			Assert(portal->resowner == NULL);
