mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
If main() is called and an argument cannot be decoded, make sure to
free the copy of the command-line. Found using Clang's static analyzer.
This commit is contained in:
parent
8a250fac15
commit
0b1b9ce494
2 changed files with 4 additions and 0 deletions
|
|
@ -10,6 +10,9 @@ What's New in Python 3.3.0 Beta 1?
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Fix a (most likely) very rare memory leak when calling main() and not being
|
||||||
|
able to decode a command-line argument.
|
||||||
|
|
||||||
- Issue #14815: Use Py_ssize_t instead of long for the object hash, to
|
- Issue #14815: Use Py_ssize_t instead of long for the object hash, to
|
||||||
preserve all 64 bits of hash on Win64.
|
preserve all 64 bits of hash on Win64.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ main(int argc, char **argv)
|
||||||
argv_copy[i] = _Py_char2wchar(argv[i], NULL);
|
argv_copy[i] = _Py_char2wchar(argv[i], NULL);
|
||||||
#endif
|
#endif
|
||||||
if (!argv_copy[i]) {
|
if (!argv_copy[i]) {
|
||||||
|
free(oldloc);
|
||||||
fprintf(stderr, "Fatal Python error: "
|
fprintf(stderr, "Fatal Python error: "
|
||||||
"unable to decode the command line argument #%i\n",
|
"unable to decode the command line argument #%i\n",
|
||||||
i + 1);
|
i + 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue