s4:registry - rpc - don't crash when communication partner isn't available
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Mon, 15 Mar 2010 12:44:00 +0000 (13:44 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Mon, 15 Mar 2010 12:44:00 +0000 (13:44 +0100)
source4/lib/registry/rpc.c

index e20138003326f694db834f44433f6c17646ac629..f3be79b9ea140c2603ba79605f1cf50b5ac398b4 100644 (file)
@@ -497,11 +497,8 @@ _PUBLIC_ WERROR reg_open_remote(struct registry_context **ctx,
 
        status = dcerpc_pipe_connect(rctx /* TALLOC_CTX */,
                                     &p, location,
-                                        &ndr_table_winreg,
+                                    &ndr_table_winreg,
                                     credentials, ev, lp_ctx);
-       rctx->pipe = p;
-       rctx->binding_handle = p->binding_handle;
-
        if(NT_STATUS_IS_ERR(status)) {
                DEBUG(1, ("Unable to open '%s': %s\n", location,
                        nt_errstr(status)));
@@ -510,6 +507,9 @@ _PUBLIC_ WERROR reg_open_remote(struct registry_context **ctx,
                return ntstatus_to_werror(status);
        }
 
+       rctx->pipe = p;
+       rctx->binding_handle = p->binding_handle;
+
        *ctx = (struct registry_context *)rctx;
        (*ctx)->ops = &reg_backend_rpc;