summaryrefslogtreecommitdiffstats
path: root/Modules/python.c
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-06-25 20:25:28 (GMT)
committerBrett Cannon <brett@python.org>2012-06-25 20:25:28 (GMT)
commit0b1b9ce494ee91ed525a83b802e15cd9a03922d5 (patch)
tree024e6b565241fbd6bebb7f7ca28abdad694d7a29 /Modules/python.c
parent8a250fac15ecb2604461ea5753638269e342eb91 (diff)
downloadcpython-0b1b9ce494ee91ed525a83b802e15cd9a03922d5.zip
cpython-0b1b9ce494ee91ed525a83b802e15cd9a03922d5.tar.gz
cpython-0b1b9ce494ee91ed525a83b802e15cd9a03922d5.tar.bz2
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.
Diffstat (limited to 'Modules/python.c')
-rw-r--r--Modules/python.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/python.c b/Modules/python.c
index cf9383f..c70bf37 100644
--- a/Modules/python.c
+++ b/Modules/python.c
@@ -51,6 +51,7 @@ main(int argc, char **argv)
argv_copy[i] = _Py_char2wchar(argv[i], NULL);
#endif
if (!argv_copy[i]) {
+ free(oldloc);
fprintf(stderr, "Fatal Python error: "
"unable to decode the command line argument #%i\n",
i + 1);