Use the future-proof-er macro to get the type structure to call the inherited free method.
diff --git a/OpenSSL/ssl/session.c b/OpenSSL/ssl/session.c
index fb9c83f..f9932a4 100644
--- a/OpenSSL/ssl/session.c
+++ b/OpenSSL/ssl/session.c
@@ -73,7 +73,7 @@
         SSL_SESSION_free(self->session);
         self->session = NULL;
     }
-    self->ob_type->tp_free((PyObject*)self);
+    Py_TYPE(self)->tp_free((PyObject*)self);
 }
 
 /*