summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-12-16 17:12:19 +0100
committerJeremy Allison <jra@samba.org>2019-01-08 03:40:28 +0100
commit6f4b2cc9659ff9da7f1e6c60678a0d4d4f453611 (patch)
tree78c29935ba154c4e33ff157316b41797325fbd5b /source4
parent186fff5fc3537eedf03a26f1419f2d4844648662 (diff)
downloadsamba-6f4b2cc9659ff9da7f1e6c60678a0d4d4f453611.tar.gz
pysecurity: Use dom_sid_str_buf
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/ndr/py_security.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source4/librpc/ndr/py_security.c b/source4/librpc/ndr/py_security.c
index 8288748b2be..eb5224dc243 100644
--- a/source4/librpc/ndr/py_security.c
+++ b/source4/librpc/ndr/py_security.c
@@ -114,18 +114,17 @@ static int py_dom_sid_cmp(PyObject *py_self, PyObject *py_other)
static PyObject *py_dom_sid_str(PyObject *py_self)
{
struct dom_sid *self = pytalloc_get_ptr(py_self);
- char *str = dom_sid_string(NULL, self);
- PyObject *ret = PyStr_FromString(str);
- talloc_free(str);
+ struct dom_sid_buf buf;
+ PyObject *ret = PyStr_FromString(dom_sid_str_buf(self, &buf));
return ret;
}
static PyObject *py_dom_sid_repr(PyObject *py_self)
{
struct dom_sid *self = pytalloc_get_ptr(py_self);
- char *str = dom_sid_string(NULL, self);
- PyObject *ret = PyStr_FromFormat("dom_sid('%s')", str);
- talloc_free(str);
+ struct dom_sid_buf buf;
+ PyObject *ret = PyStr_FromFormat(
+ "dom_sid('%s')", dom_sid_str_buf(self, &buf));
return ret;
}