From d1640328eb04352b0e486f6e6380e88c7be4cb50 Mon Sep 17 00:00:00 2001 From: Sven Trenkel Date: Sun, 4 Oct 2015 00:05:24 +0000 Subject: [PATCH] python: Fix double-free bug. --- src/python.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/python.c b/src/python.c index 10ac8f0d..95240afb 100644 --- a/src/python.c +++ b/src/python.c @@ -289,7 +289,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) { @@ -309,9 +309,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) { -- 2.11.0