From c52ed2cbdc5b851ebc7bc19d7c682b14a4a16ba4 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 9 Aug 2010 14:43:54 +0200 Subject: Python reference counter was not properly set for etherinfo_ipv6addr objects This caused a double free situation, when Python tried to free the object if the etherinfo::get_ipv6_addresses() method was called several times. In addition the ethtool::get_interfaces_info() would also free the structures uses by etherinfo_ipv6addr objects. Signed-off-by: David Sommerseth --- python-ethtool/etherinfo_obj.c | 1 + 1 file changed, 1 insertion(+) (limited to 'python-ethtool/etherinfo_obj.c') diff --git a/python-ethtool/etherinfo_obj.c b/python-ethtool/etherinfo_obj.c index b651a1c..04eb634 100644 --- a/python-ethtool/etherinfo_obj.c +++ b/python-ethtool/etherinfo_obj.c @@ -234,6 +234,7 @@ PyObject * _ethtool_etherinfo_get_ipv6_addresses(etherinfo_py *self, PyObject *n if( ipv6_pyobj ) { PyTuple_SetItem(ret, i++, ipv6_pyobj); _PyTuple_Resize(&ret, i+1); + Py_INCREF(ipv6_pyobj); } ipv6 = next; } -- cgit