From ced158d25066a236fba36c0e8391de1eab301a17 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 16 Dec 2008 08:34:48 +0100 Subject: s4:ldb.i: hang the dn on the NULL context as the python destructor will free it This fixes a bug in the ldb.i python wrapper, that showed up under valgrind. Signed-off-by: Stefan Metzmacher --- source4/lib/ldb/ldb.i | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source4/lib/ldb/ldb.i b/source4/lib/ldb/ldb.i index 0f05c1fbab..7831d6da60 100644 --- a/source4/lib/ldb/ldb.i +++ b/source4/lib/ldb/ldb.i @@ -575,6 +575,8 @@ static void py_ldb_debug(void *context, enum ldb_debug_level level, const char * if (ldif == NULL) { return Py_None; } else { + /* We don't want this attached to the 'ldb' any more */ + talloc_steal(NULL, ldif); return Py_BuildValue((char *)"(iO)", ldif->changetype, SWIG_NewPointerObj(ldif->msg, SWIGTYPE_p_ldb_message, 0)); } -- cgit