s4:ldb.i: hang the dn on the NULL context as the python destructor will free it
authorAndrew Bartlett <abartlet@samba.org>
Tue, 16 Dec 2008 07:34:48 +0000 (08:34 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 17 Dec 2008 01:29:25 +0000 (12:29 +1100)
This fixes a bug in the ldb.i python wrapper, that showed up under valgrind.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/lib/ldb/ldb.i

index 0f05c1fbab6bfaf66938bb5c0e734ea9d2da96cf..7831d6da606516b31b43888bc201f1fc30dd3792 100644 (file)
@@ -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));
         }