spoolss: Avoid indirection via ndr_get_array_size()
authorAndrew Bartlett <abartlet@samba.org>
Fri, 21 May 2021 20:46:26 +0000 (08:46 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 2 Jun 2021 03:56:36 +0000 (03:56 +0000)
This is set in the call just above and otherwise we will (in the next commit)
need an intermediate variable once we need to check error codes from
ndr_get_array_size().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14710

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
librpc/ndr/ndr_spoolss_buf.c

index 393d7addeb531d9244a068e48ff3c001de891650..9b98dd36143bc6c5868d21e6cea4817e4801edd9 100644 (file)
@@ -1084,7 +1084,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr,
 #else
                        NDR_CHECK(ndr_token_store(ndr, &ndr->array_size_list, &r->file_info, r->file_count));
 #endif
-                       NDR_PULL_ALLOC_N(ndr, r->file_info, ndr_get_array_size(ndr, &r->file_info));
+                       NDR_PULL_ALLOC_N(ndr, r->file_info, r->file_count);
                        _mem_save_file_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->file_info, 0);
                        for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) {