summaryrefslogtreecommitdiffstats
path: root/Modules/readline.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-11-13 07:43:21 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-11-13 07:43:21 (GMT)
commitf56d015a7123de2df3a32bc38f666a79dd8cab79 (patch)
treed6fa274862800df9c14d17d7fce7f9ea3130c854 /Modules/readline.c
parentadd09b4149b17afa30aa042dbb718b9d9ec741c3 (diff)
downloadcpython-f56d015a7123de2df3a32bc38f666a79dd8cab79.zip
cpython-f56d015a7123de2df3a32bc38f666a79dd8cab79.tar.gz
cpython-f56d015a7123de2df3a32bc38f666a79dd8cab79.tar.bz2
Patch #804543: strdup saved locales. Backported to 2.3.
Diffstat (limited to 'Modules/readline.c')
-rw-r--r--Modules/readline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index 5053d1c..7535ecf 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -611,7 +611,7 @@ static void
setup_readline(void)
{
#ifdef SAVE_LOCALE
- char *saved_locale = setlocale(LC_CTYPE, NULL);
+ char *saved_locale = strdup(setlocale(LC_CTYPE, NULL));
#endif
using_history();
@@ -652,6 +652,7 @@ setup_readline(void)
#ifdef SAVE_LOCALE
setlocale(LC_CTYPE, saved_locale); /* Restore locale */
+ free(saved_locale);
#endif
}