From: Sven Trenkel Date: Sun, 4 Oct 2015 00:05:24 +0000 (+0000) Subject: python: Fix double-free bug. X-Git-Tag: collectd-5.6.0~592^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9a54b49974e35c433d364a56fb9c228d578a9934;p=collectd.git python: Fix double-free bug. --- diff --git a/src/python.c b/src/python.c index b7cc5b91..210d785c 100644 --- a/src/python.c +++ b/src/python.c @@ -302,7 +302,7 @@ void cpy_log_exception(const char *context) { Py_XDECREF(traceback); return; } - list = PyObject_CallFunction(cpy_format_exception, "NNN", type, value, traceback); /* New reference. */ + list = PyObject_CallFunction(cpy_format_exception, "NNN", type, value, traceback); /* New reference. Steals references from "type", "value" and "traceback". */ if (list) l = PyObject_Length(list); for (i = 0; i < l; ++i) { @@ -322,9 +322,6 @@ void cpy_log_exception(const char *context) { } Py_XDECREF(list); PyErr_Clear(); - Py_DECREF(type); - Py_XDECREF(value); - Py_XDECREF(traceback); } static int cpy_read_callback(user_data_t *data) {