s4-server: check the return of irpc_binding_handle_by_name
authorAndrew Tridgell <tridge@samba.org>
Wed, 15 Sep 2010 03:14:42 +0000 (13:14 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 15 Sep 2010 05:39:36 +0000 (15:39 +1000)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/smbd/service_task.c

index 8edd49e25977a8b8a6af3d96a8b5c55267e32a24..1eb8403e3b1fa41ecbb35d193012905091e6ea6e 100644 (file)
@@ -40,9 +40,10 @@ void task_server_terminate(struct task_server *task, const char *reason, bool fa
 
                irpc_handle = irpc_binding_handle_by_name(task, task->msg_ctx,
                                                          "samba", &ndr_table_irpc);
-
-               r.in.reason = reason;
-               dcerpc_samba_terminate_r(irpc_handle, task, &r);
+               if (irpc_handle != NULL) {
+                       r.in.reason = reason;
+                       dcerpc_samba_terminate_r(irpc_handle, task, &r);
+               }
        }
 
        model_ops->terminate(event_ctx, task->lp_ctx, reason);