1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

python: Ensure reference counts are properly incremented

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Joseph Sutton 2021-05-03 14:42:10 +12:00 committed by Jeremy Allison
parent 78a0b57b51
commit 290c1dc097
7 changed files with 10 additions and 10 deletions

View File

@ -41,7 +41,7 @@ static PyObject *pytalloc_report_full(PyObject *self, PyObject *args)
} else {
talloc_report_full(pytalloc_get_mem_ctx(py_obj), stdout);
}
return Py_None;
Py_RETURN_NONE;
}
/* enable null tracking */
@ -49,7 +49,7 @@ static PyObject *pytalloc_enable_null_tracking(PyObject *self,
PyObject *Py_UNUSED(ignored))
{
talloc_enable_null_tracking();
return Py_None;
Py_RETURN_NONE;
}
/* return the number of talloc blocks */

View File

@ -41,7 +41,7 @@ static PyObject* GPO_get_##ATTR(PyObject *self, void *closure) \
if (gpo_ptr->ATTR) \
return PyUnicode_FromString(gpo_ptr->ATTR); \
else \
return Py_None; \
Py_RETURN_NONE; \
}
GPO_getter(ds_path)
GPO_getter(file_sys_path)

View File

@ -426,9 +426,9 @@ static PyObject *py_gensec_have_feature(PyObject *self, PyObject *args)
return NULL;
if (gensec_have_feature(security, feature)) {
return Py_True;
Py_RETURN_TRUE;
}
return Py_False;
Py_RETURN_FALSE;
}
static PyObject *py_gensec_set_max_update_size(PyObject *self, PyObject *args)

View File

@ -342,7 +342,7 @@ static PyObject *py_descriptor_richcmp(
break;
}
return Py_NotImplemented;
Py_RETURN_NOTIMPLEMENTED;
}
static void py_descriptor_patch(PyTypeObject *type)

View File

@ -32,7 +32,7 @@
static PyObject *py_is_xattr_supported(PyObject *self,
PyObject *Py_UNUSED(ignored))
{
return Py_True;
Py_RETURN_TRUE;
}
static PyObject *py_wrap_setxattr(PyObject *self, PyObject *args)

View File

@ -29,9 +29,9 @@ static PyObject *py_is_xattr_supported(PyObject *self,
PyObject *Py_UNUSED(ignored))
{
#if !defined(HAVE_XATTR_SUPPORT)
return Py_False;
Py_RETURN_FALSE;
#else
return Py_True;
Py_RETURN_TRUE;
#endif
}

View File

@ -36,7 +36,7 @@
static PyObject *py_is_xattr_supported(PyObject *self,
PyObject *Py_UNUSED(ignored))
{
return Py_True;
Py_RETURN_TRUE;
}
static PyObject *py_wrap_setxattr(PyObject *self, PyObject *args)