s3:dcerpc_up: avoid useless talloc_zero() calls
authorStefan Metzmacher <metze@samba.org>
Thu, 30 Jan 2014 08:54:24 +0000 (09:54 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 11 Feb 2014 15:20:28 +0000 (16:20 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/librpc/rpc/dcerpc_ep.c

index 99a88c425125c09b2caf3b37041dd28c27183c46..ee2d8355def7d1d53e05ac345915437968b49129 100644 (file)
@@ -103,12 +103,9 @@ NTSTATUS dcerpc_binding_vector_add_np_default(const struct ndr_interface_table *
        for (i = 0; i < ep_count; i++) {
                struct dcerpc_binding *b;
 
-               b = talloc_zero(bvec->bindings, struct dcerpc_binding);
-               if (b == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-               }
-
-               status = dcerpc_parse_binding(b, iface->endpoints->names[i], &b);
+               status = dcerpc_parse_binding(bvec->bindings,
+                                             iface->endpoints->names[i],
+                                             &b);
                if (!NT_STATUS_IS_OK(status)) {
                        return NT_STATUS_UNSUCCESSFUL;
                }
@@ -153,12 +150,9 @@ NTSTATUS dcerpc_binding_vector_add_port(const struct ndr_interface_table *iface,
        for (i = 0; i < ep_count; i++) {
                struct dcerpc_binding *b;
 
-               b = talloc_zero(bvec->bindings, struct dcerpc_binding);
-               if (b == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-               }
-
-               status = dcerpc_parse_binding(b, iface->endpoints->names[i], &b);
+               status = dcerpc_parse_binding(bvec->bindings,
+                                             iface->endpoints->names[i],
+                                             &b);
                if (!NT_STATUS_IS_OK(status)) {
                        return NT_STATUS_UNSUCCESSFUL;
                }
@@ -209,12 +203,9 @@ NTSTATUS dcerpc_binding_vector_add_unix(const struct ndr_interface_table *iface,
        for (i = 0; i < ep_count; i++) {
                struct dcerpc_binding *b;
 
-               b = talloc_zero(bvec->bindings, struct dcerpc_binding);
-               if (b == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-               }
-
-               status = dcerpc_parse_binding(b, iface->endpoints->names[i], &b);
+               status = dcerpc_parse_binding(bvec->bindings,
+                                             iface->endpoints->names[i],
+                                             &b);
                if (!NT_STATUS_IS_OK(status)) {
                        return NT_STATUS_UNSUCCESSFUL;
                }