Commit 39e0500c authored by Stefan Behnel's avatar Stefan Behnel

handle malloc() failure in encoding setup code

--HG--
extra : transplant_source : %F3%9A%B7r%F7%DB%C7%88%2B%D2%A4%9C%5E%0FT%B8_XS%D2
parent c10c557b
......@@ -135,6 +135,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
if (default_encoding == NULL) goto bad;
default_encoding_c = PyBytes_AS_STRING(default_encoding);
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
if (__PYX_DEFAULT_STRING_ENCODING == NULL) goto bad;
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
Py_DECREF(sys);
Py_DECREF(default_encoding);
......
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