r22515: only steal pipe on success
authorStefan Metzmacher <metze@samba.org>
Wed, 25 Apr 2007 12:36:12 +0000 (12:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:51:35 +0000 (14:51 -0500)
metze
(This used to be commit acfaba06f51184df5f1e99f0acd6fd0bd5f34afc)

source4/librpc/rpc/dcerpc_connect.c

index b1cdff9287495d666cfa111323add397a79c25c4..102441375bdadb5ec3145a516e44b52e12b2c963 100644 (file)
@@ -889,9 +889,10 @@ NTSTATUS dcerpc_pipe_connect_recv(struct composite_context *c,
        struct pipe_conn_state *s;
 
        status = composite_wait(c);
-       s = talloc_get_type(c->private_data, struct pipe_conn_state);
-       *pp = talloc_steal(mem_ctx, s->pipe);
-
+       if (NT_STATUS_IS_OK(status)) {
+               s = talloc_get_type(c->private_data, struct pipe_conn_state);
+               *pp = talloc_steal(mem_ctx, s->pipe);
+       }
        talloc_free(c);
        return status;
 }