svn commit: samba r25792 - in branches/SAMBA_4_0/source/librpc/ndr: .

metze at samba.org metze at samba.org
Fri Nov 2 10:26:50 GMT 2007


Author: metze
Date: 2007-11-02 10:26:49 +0000 (Fri, 02 Nov 2007)
New Revision: 25792

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25792

Log:
use NT_STATUS_HAVE_NO_MEMORY() and NDR_CHECK()

metze
Modified:
   branches/SAMBA_4_0/source/librpc/ndr/ndr.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/ndr/ndr.c	2007-11-02 09:15:12 UTC (rev 25791)
+++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c	2007-11-02 10:26:49 UTC (rev 25792)
@@ -791,17 +791,12 @@
 _PUBLIC_ NTSTATUS ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p,
 			      ndr_push_flags_fn_t fn)
 {
-	NTSTATUS status;
 	struct ndr_push *ndr;
 	ndr = ndr_push_init_ctx(mem_ctx);
-	if (!ndr) {
-		return NT_STATUS_NO_MEMORY;
-	}
-	status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p);
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
-	}
+	NT_STATUS_HAVE_NO_MEMORY(ndr);
 
+	NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
+
 	*blob = ndr_push_blob(ndr);
 	talloc_steal(mem_ctx, blob->data);
 	talloc_free(ndr);
@@ -815,17 +810,12 @@
 _PUBLIC_ NTSTATUS ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p,
 			     uint32_t level, ndr_push_flags_fn_t fn)
 {
-	NTSTATUS status;
 	struct ndr_push *ndr;
 	ndr = ndr_push_init_ctx(mem_ctx);
-	if (!ndr) {
-		return NT_STATUS_NO_MEMORY;
-	}
+	NT_STATUS_HAVE_NO_MEMORY(ndr);
+
 	ndr_push_set_switch_value(ndr, p, level);
-	status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p);
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
-	}
+	NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p));
 
 	*blob = ndr_push_blob(ndr);
 	talloc_steal(mem_ctx, blob->data);



More information about the samba-cvs mailing list