Skip to content

Commit

Permalink
python: Ensure reference counts are properly incremented
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Sutton <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
Reviewed-by: Douglas Bagnall <[email protected]>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14817
(cherry picked from commit 290c1dc)
  • Loading branch information
jsutton24 authored and Jule Anger committed Sep 16, 2021
1 parent 795e2b4 commit de40f47
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/talloc/pytalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ 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 */
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 */
Expand Down
2 changes: 1 addition & 1 deletion libgpo/pygpo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions source4/auth/gensec/pygensec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion source4/librpc/ndr/py_security.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static PyObject *py_descriptor_richcmp(
break;
}

return Py_NotImplemented;
Py_RETURN_NOTIMPLEMENTED;
}

static void py_descriptor_patch(PyTypeObject *type)
Expand Down
2 changes: 1 addition & 1 deletion source4/ntvfs/posix/python/pyposix_eadb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions source4/ntvfs/posix/python/pyxattr_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion source4/ntvfs/posix/python/pyxattr_tdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit de40f47

Please sign in to comment.