From 2e7a6cb6bf32a49682ccadc07244d3a6ae4058d3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 21 Dec 2008 03:08:14 +0100 Subject: py: Fix initialisation of subtypes, fix segfaults. --- lib/talloc/pytalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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; -- cgit