From: Volker Lendecke Date: Tue, 24 Feb 2026 09:43:09 +0000 (+0100) Subject: winbindd: Simplify winbindd_lookuprids_recv() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f8955988534caa2edf36dc30610d6416a623dce;p=thirdparty%2Fsamba.git winbindd: Simplify winbindd_lookuprids_recv() Only check for NULL once with talloc_asprintf_addbuf() Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke --- diff --git a/source3/winbindd/winbindd_lookuprids.c b/source3/winbindd/winbindd_lookuprids.c index fc8fa46f4d3..f7650340d00 100644 --- a/source3/winbindd/winbindd_lookuprids.c +++ b/source3/winbindd/winbindd_lookuprids.c @@ -128,18 +128,18 @@ NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req, } result = talloc_strdup(response, ""); - if (result == NULL) { - return NT_STATUS_NO_MEMORY; - } for (i=0; inames.num_principals; i++) { struct wbint_Principal *p = &state->names.principals[i]; - result = talloc_asprintf_append_buffer( - result, "%d %s\n", (int)p->type, p->name); - if (result == NULL) { - return NT_STATUS_NO_MEMORY; - } + talloc_asprintf_addbuf(&result, + "%d %s\n", + (int)p->type, + p->name); + } + + if (result == NULL) { + return NT_STATUS_NO_MEMORY; } fstrcpy(response->data.domain_name, state->domain_name);