From: Douglas Bagnall Date: Thu, 1 Aug 2019 04:02:05 +0000 (+1200) Subject: s4/messaging/py: don't DECREF borrowed references X-Git-Url: http://git.samba.org/samba.git/?p=gd%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=d6a82edd19b82d99401a27dbc6fe10121142e431 s4/messaging/py: don't DECREF borrowed references This made Message.deregister() a decref machine, with talloc crashes and segfaults available thus: from samba import messaging m = messaging.Messaging() for i in range(20): m.deregister(m) Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c index 39c09a82403..e506d94f474 100644 --- a/source4/lib/messaging/pymessaging.c +++ b/source4/lib/messaging/pymessaging.c @@ -259,8 +259,6 @@ static PyObject *py_imessaging_deregister(PyObject *self, PyObject *args, PyObje imessaging_deregister(iface->msg_ctx, msg_type, callback); - Py_DECREF(callback); - Py_RETURN_NONE; }