From 97a8c5e4b6a3c8ec1440147fea7b60aa411e740a Mon Sep 17 00:00:00 2001 From: "roberto@debian64" Date: Thu, 2 Feb 2012 11:40:52 +0100 Subject: [PATCH] another fix for pyargv --- plugins/python/pyutils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/python/pyutils.c b/plugins/python/pyutils.c index 78feb87e..49afa174 100644 --- a/plugins/python/pyutils.c +++ b/plugins/python/pyutils.c @@ -72,7 +72,8 @@ void init_pyargv() { #endif up.argc = 1; - char *tmp_ptr = uwsgi_str(up.argv); + if (up.argv) { + char *tmp_ptr = uwsgi_str(up.argv); #ifdef __sun__ // FIX THIS !!! ap = strtok(tmp_ptr, " "); @@ -85,7 +86,8 @@ void init_pyargv() { } } - free(tmp_ptr); + free(tmp_ptr); + } #ifdef PYTHREE up.py_argv = uwsgi_calloc(sizeof(wchar_t *) * up.argc+1);