From c73f11bc8d2d0d6f7cd74abe97ad85dfd85761a3 Mon Sep 17 00:00:00 2001 From: Unbit Date: Fri, 15 May 2015 06:41:31 +0200 Subject: [PATCH] attempt to fix a bug spotted by funkybob on irc --- plugins/python/python_plugin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 912a4497..617470a0 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -1704,6 +1704,8 @@ int uwsgi_python_spooler(char *filename, char *buf, uint16_t len, char *body, si PyDict_SetItemString(spool_dict, "body", value); Py_DECREF(value); } + // PyTuple_SetItem steals a reference !!! + Py_INCREF(spool_dict); PyTuple_SetItem(pyargs, 0, spool_dict); ret = python_call(spool_func, pyargs, 0, NULL);