summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/dcerpc.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 2c90c62ef5..b485864c7b 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -565,15 +565,19 @@ static void dcerpc_recv_data(struct dcerpc_connection *conn, DATA_BLOB *blob, NT
}
switch (pkt.ptype) {
- case DCERPC_PKT_BIND_ACK:
case DCERPC_PKT_BIND_NAK:
- dcerpc_bind_recv_data(conn, &pkt);
- data_blob_free(blob);
+ case DCERPC_PKT_BIND_ACK:
+ if (conn->bind_private) {
+ talloc_steal(conn->bind_private, blob->data);
+ dcerpc_bind_recv_data(conn, &pkt);
+ }
break;
case DCERPC_PKT_ALTER_RESP:
- dcerpc_alter_recv_data(conn, &pkt);
- data_blob_free(blob);
+ if (conn->alter_private) {
+ talloc_steal(conn->alter_private, blob->data);
+ dcerpc_alter_recv_data(conn, &pkt);
+ }
break;
default:
@@ -592,10 +596,6 @@ static void dcerpc_bind_recv_data(struct dcerpc_connection *conn, struct ncacn_p
struct composite_context *c;
struct dcerpc_pipe *pipe;
- if (conn->bind_private == NULL) {
- /* it timed out earlier */
- return;
- }
c = talloc_get_type(conn->bind_private, struct composite_context);
pipe = talloc_get_type(c->private_data, struct dcerpc_pipe);
@@ -1526,11 +1526,6 @@ static void dcerpc_alter_recv_data(struct dcerpc_connection *conn, struct ncacn_
struct composite_context *c;
struct dcerpc_pipe *pipe;
- if (conn->alter_private == NULL) {
- /* it timed out earlier */
- return;
- }
-
c = talloc_get_type(conn->alter_private, struct composite_context);
pipe = talloc_get_type(c->private_data, struct dcerpc_pipe);