Commit c0d5faa9 authored by Neal Norwitz's avatar Neal Norwitz

Free coding spec (cs) if there was an error to prevent mem leak. Maybe backport candidate

parent 1e8659b9
...@@ -277,11 +277,14 @@ check_coding_spec(const char* line, int size, struct tok_state *tok, ...@@ -277,11 +277,14 @@ check_coding_spec(const char* line, int size, struct tok_state *tok,
tok->encoding = cs; tok->encoding = cs;
tok->decoding_state = -1; tok->decoding_state = -1;
} }
else
PyMem_DEL(cs);
#else #else
/* Without Unicode support, we cannot /* Without Unicode support, we cannot
process the coding spec. Since there process the coding spec. Since there
won't be any Unicode literals, that won't be any Unicode literals, that
won't matter. */ won't matter. */
PyMem_DEL(cs);
#endif #endif
} }
} else { /* then, compare cs with BOM */ } else { /* then, compare cs with BOM */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment