diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2003-11-13 07:43:21 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2003-11-13 07:43:21 (GMT) |
commit | f56d015a7123de2df3a32bc38f666a79dd8cab79 (patch) | |
tree | d6fa274862800df9c14d17d7fce7f9ea3130c854 /Modules/readline.c | |
parent | add09b4149b17afa30aa042dbb718b9d9ec741c3 (diff) | |
download | cpython-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.c | 3 |
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 } |