From: Volker Lendecke Date: Wed, 30 Nov 2022 13:48:33 +0000 (+0100) Subject: libads: Save intermediate NULL checks with talloc_asprintf_addbuf() X-Git-Tag: talloc-2.4.0~242 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac78cb71d69d0307a668311e94e7181db6ad840e;p=thirdparty%2Fsamba.git libads: Save intermediate NULL checks with talloc_asprintf_addbuf() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Dec 14 05:29:51 UTC 2022 on sn-devel-184 --- diff --git a/source3/libads/ldap_schema.c b/source3/libads/ldap_schema.c index 85b322c1fe2..d2f486e4918 100644 --- a/source3/libads/ldap_schema.c +++ b/source3/libads/ldap_schema.c @@ -49,19 +49,14 @@ static ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads, return ADS_ERROR_NT(NT_STATUS_NONE_MAPPED); } - if ((expr = talloc_asprintf(mem_ctx, "(|")) == NULL) { - return ADS_ERROR(LDAP_NO_MEMORY); - } + expr = talloc_asprintf(mem_ctx, "(|"); for (i=0; i