diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index 6c7cfdad1e6..b542c162392 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -970,7 +970,7 @@ row_vers_old_has_index_entry(
 				entry = row_build_index_entry(
 					row, ext, index, heap);
 				if (entry && !dtuple_coll_cmp(ientry, entry)) {
-					goto safe_to_purge;
+					goto unsafe_to_purge;
 				}
 			} else {
 				/* Build index entry out of row */
@@ -991,7 +991,7 @@ row_vers_old_has_index_entry(
 					    clust_index, clust_offsets,
 					    index, ientry, roll_ptr,
 					    trx_id, NULL, &vrow, mtr)) {
-					goto safe_to_purge;
+					goto unsafe_to_purge;
 				}
 			}
 			clust_offsets = rec_get_offsets(rec, clust_index, NULL,
@@ -1024,7 +1024,7 @@ row_vers_old_has_index_entry(
 			a different binary value in a char field, but the
 			collation identifies the old and new value anyway! */
 			if (entry && !dtuple_coll_cmp(ientry, entry)) {
-safe_to_purge:
+unsafe_to_purge:
 				mem_heap_free(heap);
 
 				if (v_heap) {
@@ -1065,7 +1065,6 @@ row_vers_old_has_index_entry(
 
 		if (!prev_version) {
 			/* Versions end here */
-unsafe_to_purge:
 			mem_heap_free(heap);
 
 			if (v_heap) {
@@ -1127,7 +1126,7 @@ row_vers_old_has_index_entry(
 			and new value anyway! */
 
 			if (entry && !dtuple_coll_cmp(ientry, entry)) {
-				goto safe_to_purge;
+				goto unsafe_to_purge;
 			}
 		}
 
