diff options
Diffstat (limited to 'source4/scripting/python/pytalloc.c')
-rw-r--r-- | source4/scripting/python/pytalloc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/scripting/python/pytalloc.c b/source4/scripting/python/pytalloc.c index 55ed56a627..4032ff75a4 100644 --- a/source4/scripting/python/pytalloc.c +++ b/source4/scripting/python/pytalloc.c @@ -22,7 +22,7 @@ void py_talloc_dealloc(PyObject* self) { py_talloc_Object *obj = (py_talloc_Object *)self; - talloc_free(obj->object); + talloc_free(obj->talloc_ptr); PyObject_Del(self); } @@ -32,3 +32,11 @@ PyObject *py_talloc_import(PyTypeObject *py_type, void *ptr) ret->talloc_ptr = talloc_reference(NULL, ptr); return ret; } + +PyObject *py_talloc_default_repr(PyObject *py_obj) +{ + py_talloc_Object *obj = (py_talloc_Object *)py_obj; + + return PyString_FromFormat("<talloc: %s>", + talloc_get_name(obj->talloc_ptr)); +} |