summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-23 07:33:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:39 -0500
commite3e066fcb4d51611ff346ba4cff23aad659c2065 (patch)
treef136fe8c529f64f163feb6ff71d1d76cf08abcf2
parent090898de71ee0bb2d10cb4f227a37b2e4c83f2da (diff)
downloadsamba-e3e066fcb4d51611ff346ba4cff23aad659c2065.tar.gz
samba-e3e066fcb4d51611ff346ba4cff23aad659c2065.tar.bz2
samba-e3e066fcb4d51611ff346ba4cff23aad659c2065.zip
r11872: another attempt at fixing the data_blob_free in async dcerpc bind,
after volker gently pointed out that I should be wearing a paper bag over my head for the last attempt :-) (This used to be commit 7e132761fce75f64d3e7d42f650c45a483e37e3e)
-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);