diff options
author | Samuel Cabrero <scabrero@samba.org> | 2022-05-24 12:44:36 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2022-06-27 15:50:29 +0000 |
commit | 577fdd0f97a6ae8e983d6b2eefe5cfc37d961161 (patch) | |
tree | 282e79aaeb2982778768c1206783b27e39c98317 /libgpo/pygpo.c | |
parent | 392cd137783ef2d51564b278187c0d85365e6520 (diff) | |
download | samba-577fdd0f97a6ae8e983d6b2eefe5cfc37d961161.tar.gz |
pygpo: Make ads_ADSType object inherit from pytalloc_BaseObject
Prepare to allocate ADS_STRUCT under a talloc context.
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libgpo/pygpo.c')
-rw-r--r-- | libgpo/pygpo.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c index b5ec85a48d4..221900e62fe 100644 --- a/libgpo/pygpo.c +++ b/libgpo/pygpo.c @@ -29,6 +29,7 @@ #include "libcli/util/pyerrors.h" #include "python/py3compat.h" #include "python/modules.h" +#include <pytalloc.h> /* A Python C API module to use LIBGPO */ @@ -498,6 +499,7 @@ static PyMethodDef ADS_methods[] = { static PyTypeObject ads_ADSType = { .tp_name = "gpo.ADS_STRUCT", .tp_basicsize = sizeof(ADS), + .tp_new = PyType_GenericNew, .tp_dealloc = (destructor)py_ads_dealloc, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "ADS struct", @@ -540,8 +542,7 @@ MODULE_INIT_FUNC(gpo) goto err; } - ads_ADSType.tp_new = PyType_GenericNew; - if (PyType_Ready(&ads_ADSType) < 0) { + if (pytalloc_BaseObject_PyType_Ready(&ads_ADSType) < 0) { goto err; } |