summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-12-21 03:08:14 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-12-21 03:08:14 +0100
commit2e7a6cb6bf32a49682ccadc07244d3a6ae4058d3 (patch)
tree1025e2107efd63e6468b3c81c291aaf7d5c11251 /lib
parentbd41b4579c26f40f55811b332874ddeca3478e24 (diff)
downloadsamba-2e7a6cb6bf32a49682ccadc07244d3a6ae4058d3.tar.gz
samba-2e7a6cb6bf32a49682ccadc07244d3a6ae4058d3.tar.bz2
samba-2e7a6cb6bf32a49682ccadc07244d3a6ae4058d3.zip
py: Fix initialisation of subtypes, fix segfaults.
Diffstat (limited to 'lib')
-rw-r--r--lib/talloc/pytalloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index f4b7d10e97..8bc85eead6 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -25,13 +25,13 @@ void py_talloc_dealloc(PyObject* self)
py_talloc_Object *obj = (py_talloc_Object *)self;
talloc_free(obj->talloc_ctx);
obj->talloc_ctx = NULL;
- PyObject_Del(self);
+ self->ob_type->tp_free(self);
}
PyObject *py_talloc_import_ex(PyTypeObject *py_type, TALLOC_CTX *mem_ctx,
void *ptr)
{
- py_talloc_Object *ret = PyObject_New(py_talloc_Object, py_type);
+ py_talloc_Object *ret = (py_talloc_Object *)py_type->tp_alloc(py_type, 0);
ret->talloc_ctx = talloc_new(NULL);
if (ret->talloc_ctx == NULL) {
return NULL;