closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800)

(cherry picked from commit 745dc65b17b3936e3f9f4099f735f174d30c4e0c)

Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
diff --git a/Objects/listobject.c b/Objects/listobject.c
index f0fe962..c8ffeff 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -86,7 +86,7 @@
 show_alloc(void)
 {
     PyInterpreterState *interp = PyThreadState_GET()->interp;
-    if (!inter->core_config.show_alloc_count) {
+    if (!interp->core_config.show_alloc_count) {
         return;
     }
 
diff --git a/Objects/object.c b/Objects/object.c
index fef57fc..220aa90 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -97,10 +97,11 @@
 dump_counts(FILE* f)
 {
     PyInterpreterState *interp = PyThreadState_GET()->interp;
-    if (!inter->core_config.show_alloc_count) {
+    if (!interp->core_config.show_alloc_count) {
         return;
     }
 
+    PyTypeObject *tp;
     for (tp = type_list; tp; tp = tp->tp_next)
         fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, "
             "freed: %" PY_FORMAT_SIZE_T "d, "
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 39d43dd..9bb91a5 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -45,7 +45,7 @@
 show_track(void)
 {
     PyInterpreterState *interp = PyThreadState_GET()->interp;
-    if (!inter->core_config.show_alloc_count) {
+    if (!interp->core_config.show_alloc_count) {
         return;
     }