diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-10-08 04:21:07 +0300 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-10-20 21:37:06 +0000 |
commit | c0b9526aaf29442f85f62232e22aecfb484b1576 (patch) | |
tree | 96e7757c0507440923549f9ea47a027fec8f67c9 /lib | |
parent | feb60345816f0fd45ea9b381fbd374b21542f518 (diff) | |
download | samba-c0b9526aaf29442f85f62232e22aecfb484b1576.tar.gz samba-c0b9526aaf29442f85f62232e22aecfb484b1576.tar.bz2 samba-c0b9526aaf29442f85f62232e22aecfb484b1576.zip |
pytalloc: use talloc_unlink() to free py_talloc objects
Those type of objects are referenced every time we assign
them to other py_talloc objects, which leads to runtime
warnings that we are trying to free an object with references
Wrap talloc_unlink() in SMB_ASSERT() to ensure we catch possible failure
Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Wed Oct 20 21:37:06 UTC 2010 on sn-devel-104
Diffstat (limited to 'lib')
-rw-r--r-- | lib/talloc/pytalloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c index b0b7394875..ae59b69625 100644 --- a/lib/talloc/pytalloc.c +++ b/lib/talloc/pytalloc.c @@ -21,6 +21,8 @@ #include "replace.h" #include <talloc.h> #include "pytalloc.h" +#include "lib/util/debug.h" +#include "lib/util/util.h" /** * Simple dealloc for talloc-wrapping PyObjects @@ -28,7 +30,7 @@ void py_talloc_dealloc(PyObject* self) { py_talloc_Object *obj = (py_talloc_Object *)self; - talloc_free(obj->talloc_ctx); + SMB_ASSERT(talloc_unlink(NULL, obj->talloc_ctx) != -1); obj->talloc_ctx = NULL; self->ob_type->tp_free(self); } |