From 14eeae09b158735f7f6e92f49ff5c0959669ac3b Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Fri, 17 Jun 2011 16:31:55 +0200 Subject: [PATCH] fix python3 + virtualenv --- plugins/python/python_plugin.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index ae01bda9..c6a2e510 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -89,14 +89,15 @@ int uwsgi_python_init() { if (up.home != NULL) { #ifdef PYTHREE wchar_t *wpyhome; - wpyhome = malloc((sizeof(wchar_t) * strlen(up.home)) + 2); + wpyhome = malloc((sizeof(wchar_t) * strlen(up.home)) + sizeof(wchar_t) ); if (!wpyhome) { uwsgi_error("malloc()"); exit(1); } mbstowcs(wpyhome, up.home, strlen(up.home)); Py_SetPythonHome(wpyhome); - free(wpyhome); + // do not free this memory !!! + //free(wpyhome); #else Py_SetPythonHome(up.home); #endif