mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Free coding spec (cs) if there was an error to prevent mem leak. Maybe backport candidate
This commit is contained in:
parent
1e8659b963
commit
c0d5faa9b4
1 changed files with 3 additions and 0 deletions
|
@ -277,11 +277,14 @@ check_coding_spec(const char* line, int size, struct tok_state *tok,
|
|||
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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue