]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_server: Move a variable closer to its use
authorVolker Lendecke <vl@samba.org>
Sun, 10 Jan 2021 12:07:54 +0000 (13:07 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 12 Jan 2021 00:10:30 +0000 (00:10 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
librpc/rpc/dcesrv_core.c

index 9113bf89976936168b2d919e99d4bbe4cb7736db..1d0c9c75ab6677a10daa71f33cd2bce90d0e3212 100644 (file)
@@ -227,7 +227,6 @@ _PUBLIC_ NTSTATUS dcesrv_interface_register(struct dcesrv_context *dce_ctx,
        transport = dcerpc_binding_get_transport(binding);
        if (transport == NCACN_IP_TCP) {
                int port;
-               char port_str[6];
 
                /*
                 * First check if there is already a port specified, eg
@@ -250,6 +249,7 @@ _PUBLIC_ NTSTATUS dcesrv_interface_register(struct dcesrv_context *dce_ctx,
                                port = lpcfg_rpc_server_port(dce_ctx->lp_ctx);
                        }
                        if (port != 0) {
+                               char port_str[6];
                                snprintf(port_str, sizeof(port_str), "%u", port);
                                status = dcerpc_binding_set_string_option(binding,
                                                                          "endpoint",