Commit 701abe74 authored by Martin v. Löwis's avatar Martin v. Löwis

Fail fatally if strdup fails.

parent cd4d297a
......@@ -675,6 +675,8 @@ setup_readline(void)
{
#ifdef SAVE_LOCALE
char *saved_locale = strdup(setlocale(LC_CTYPE, NULL));
if (!saved_locale)
Py_FatalError("not enough memory to save locale");
#endif
using_history();
......@@ -823,6 +825,8 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
{
#ifdef SAVE_LOCALE
char *saved_locale = strdup(setlocale(LC_CTYPE, NULL));
if (!saved_locale)
Py_FatalError("not enough memory to save locale");
setlocale(LC_CTYPE, "");
#endif
size_t n;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment