]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpc_server: Use talloc_zero for dcerpc_ncacn_listen_state
authorSamuel Cabrero <scabrero@suse.de>
Tue, 4 Jun 2019 15:04:32 +0000 (17:04 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 22 Jul 2019 16:49:14 +0000 (16:49 +0000)
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_server/rpc_server.c

index cb2d4669256847a90ce88274d5674539369c8067..22e1a4703f82c3cfad5ba54ea12a221d5a66a46e 100644 (file)
@@ -156,8 +156,8 @@ NTSTATUS dcesrv_setup_ncacn_np_socket(const char *pipe_name,
        int rc;
        NTSTATUS status;
 
-       state = talloc(ev_ctx, struct dcerpc_ncacn_listen_state);
-       if (!state) {
+       state = talloc_zero(ev_ctx, struct dcerpc_ncacn_listen_state);
+       if (state == NULL) {
                DBG_ERR("Out of memory\n");
                return NT_STATUS_NO_MEMORY;
        }
@@ -662,7 +662,7 @@ NTSTATUS dcesrv_setup_ncacn_ip_tcp_socket(struct tevent_context *ev_ctx,
        int rc;
        NTSTATUS status;
 
-       state = talloc(ev_ctx, struct dcerpc_ncacn_listen_state);
+       state = talloc_zero(ev_ctx, struct dcerpc_ncacn_listen_state);
        if (state == NULL) {
                DBG_ERR("Out of memory\n");
                return NT_STATUS_NO_MEMORY;
@@ -846,7 +846,7 @@ NTSTATUS dcesrv_setup_ncalrpc_socket(struct tevent_context *ev_ctx,
        int rc;
        NTSTATUS status;
 
-       state = talloc(ev_ctx, struct dcerpc_ncacn_listen_state);
+       state = talloc_zero(ev_ctx, struct dcerpc_ncacn_listen_state);
        if (state == NULL) {
                DBG_ERR("Out of memory\n");
                return NT_STATUS_NO_MEMORY;