Decrement references to python objects passed to Py_BuildValue
authorNoel Power <noel.power@suse.com>
Tue, 22 Jan 2019 18:26:23 +0000 (18:26 +0000)
committerNoel Power <npower@samba.org>
Thu, 7 Feb 2019 12:44:30 +0000 (13:44 +0100)
commita8e10a12493fdb6b8347b14e157aeb619cf2d2da
treefce0edcc38dd3b827744708ec748d306c84512e1
parentbf91ee0a9727cc392583fe84ad069204be758515
Decrement references to python objects passed to Py_BuildValue

Py_BuildValue when processing format 'O' will
  'Pass a Python object untouched (except for its reference count,
   which is incremented by one'

Basically this means if you are using a new reference to a PyObject
to pass to BuildValue (to be used with the 'O' format) the reference
*isn't* stolen so you really do need to DECREF it in order to ensure
it gets cleaned up.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
auth/credentials/pycredentials.c
lib/ldb/pyldb.c
source3/libsmb/pylibsmb.c
source4/dns_server/pydns.c