]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbindd: Call dom_sid_str_buf() only once
authorVolker Lendecke <vl@samba.org>
Tue, 24 Feb 2026 09:15:27 +0000 (10:15 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 25 Feb 2026 12:33:39 +0000 (12:33 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/winbindd/winbindd_getuserdomgroups.c

index 75eb4376c44fcb4aa7ae56208eeb4ea63f3943bb..3187be6d5864b30c54f3418840d173a346210263 100644 (file)
@@ -107,14 +107,12 @@ NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
                 state->num_sids);
        for (i=0; i<state->num_sids; i++) {
                struct dom_sid_buf tmp;
-               sidlist = talloc_asprintf_append_buffer(
-                       sidlist, "%s\n",
-                       dom_sid_str_buf(&state->sids[i], &tmp));
+               const char *str = dom_sid_str_buf(&state->sids[i], &tmp);
+               sidlist = talloc_asprintf_append_buffer(sidlist, "%s\n", str);
                if (sidlist == NULL) {
                        return NT_STATUS_NO_MEMORY;
                }
-               D_NOTICE("%"PRIu32": %s\n",
-                        i, dom_sid_str_buf(&state->sids[i], &tmp));
+               D_NOTICE("%" PRIu32 ": %s\n", i, str);
        }
        response->extra_data.data = sidlist;
        response->length += talloc_get_size(sidlist);