[Python-checkins] r70030 - in python/branches/release30-maint: Modules/python.c
georg.brandl
python-checkins at python.org
Fri Feb 27 18:54:11 CET 2009
Author: georg.brandl
Date: Fri Feb 27 18:54:11 2009
New Revision: 70030
Log:
Merged revisions 70029 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k
........
r70029 | georg.brandl | 2009年02月27日 18:52:38 +0100 (Fr, 27 Feb 2009) | 1 line
another instance of #804543: use strdup() when saving the result of setlocale() because it could be overwritten by subsequent setlocale()s.
........
Modified:
python/branches/release30-maint/ (props changed)
python/branches/release30-maint/Modules/python.c
Modified: python/branches/release30-maint/Modules/python.c
==============================================================================
--- python/branches/release30-maint/Modules/python.c (original)
+++ python/branches/release30-maint/Modules/python.c Fri Feb 27 18:54:11 2009
@@ -37,7 +37,7 @@
fprintf(stderr, "out of memory\n");
return 1;
}
- oldloc = setlocale(LC_ALL, NULL);
+ oldloc = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, "");
for (i = 0; i < argc; i++) {
#ifdef HAVE_BROKEN_MBSTOWCS
@@ -67,6 +67,7 @@
}
}
setlocale(LC_ALL, oldloc);
+ free(oldloc);
res = Py_Main(argc, argv_copy);
for (i = 0; i < argc; i++) {
PyMem_Free(argv_copy2[i]);
More information about the Python-checkins
mailing list