This commit is contained in:
roberto@quantal64
2012-07-08 20:18:56 +02:00
parent 3e2115aa21
commit 5a7b5d37b4
+3 -2
View File
@@ -170,12 +170,13 @@ int uwsgi_python_init() {
if (up.home != NULL) {
#ifdef PYTHREE
wchar_t *wpyhome;
wpyhome = malloc((sizeof(wchar_t) * strlen(up.home)) + sizeof(wchar_t) );
size_t len = strlen(up.home) + 1;
wpyhome = uwsgi_calloc(sizeof(wchar_t) * len );
if (!wpyhome) {
uwsgi_error("malloc()");
exit(1);
}
mbstowcs(wpyhome, up.home, strlen(up.home));
mbstowcs(wpyhome, up.home, len);
Py_SetPythonHome(wpyhome);
// do not free this memory !!!
//free(wpyhome);