summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index d0e4a0e..109c0ee 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -235,7 +235,10 @@ get_coding_spec(const char *s, Py_ssize_t size)
if (begin < t) {
char* r = new_string(begin, t - begin);
- char* q = get_normal_name(r);
+ char* q;
+ if (!r)
+ return NULL;
+ q = get_normal_name(r);
if (r != q) {
PyMem_FREE(r);
r = new_string(q, strlen(q));