From: Andrew Bartlett Date: Tue, 16 Dec 2008 07:34:48 +0000 (+0100) Subject: s4:ldb.i: hang the dn on the NULL context as the python destructor will free it X-Git-Tag: samba-4.0.0alpha6~462^2~14^2~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ced158d25066a236fba36c0e8391de1eab301a17;p=thirdparty%2Fsamba.git 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 --- diff --git a/source4/lib/ldb/ldb.i b/source4/lib/ldb/ldb.i index 0f05c1fbab6..7831d6da606 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)); }