Free coding spec (cs) if there was an error to prevent mem leak.  Maybe backport candidate
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index ce61322..5a9bcc0 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -277,11 +277,14 @@
 					tok->encoding = cs;
 					tok->decoding_state = -1;
 				}
+				else
+					PyMem_DEL(cs);
 #else
                                 /* Without Unicode support, we cannot
                                    process the coding spec. Since there
                                    won't be any Unicode literals, that
                                    won't matter. */
+				PyMem_DEL(cs);
 #endif
 			}
 		} else {	/* then, compare cs with BOM */