pylibsmb: Avoid talloc()
authorVolker Lendecke <vl@samba.org>
Sun, 28 Apr 2024 14:29:23 +0000 (16:29 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 30 Apr 2024 22:44:32 +0000 (22:44 +0000)
dom_sid_string() does an implicit talloc_strdup() which is not
necessary here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/pylibsmb.c

index fca02ea082daf83377457c107b9eadf8836dcd0d..767187913f6be48b29fe17ce380e572f714776c3 100644 (file)
@@ -1886,6 +1886,7 @@ static NTSTATUS list_posix_helper(struct file_info *finfo,
 {
        PyObject *result = (PyObject *)state;
        PyObject *file = NULL;
+       struct dom_sid_buf owner_buf, group_buf;
        int ret;
 
        /*
@@ -1923,9 +1924,9 @@ static NTSTATUS list_posix_helper(struct file_info *finfo,
                             "reparse_tag",
                             finfo->reparse_tag,
                             "owner_sid",
-                            dom_sid_string(finfo, &finfo->owner_sid),
+                            dom_sid_str_buf(&finfo->owner_sid, &owner_buf),
                             "group_sid",
-                            dom_sid_string(finfo, &finfo->group_sid),
+                            dom_sid_str_buf(&finfo->group_sid, &group_buf),
                             "reparse_tag",
                             (unsigned long)finfo->reparse_tag);
        if (file == NULL) {