summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-07-24 11:48:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:28:58 -0500
commit798fc28a6a1c660ea65cfd56c4c50ab425b728cd (patch)
treecde113250c8c4f20f2f791a8492e8df9c3d4d5ed
parent33c57437a497f14c6f554c254cbb00b08f73e382 (diff)
downloadsamba-798fc28a6a1c660ea65cfd56c4c50ab425b728cd.tar.gz
samba-798fc28a6a1c660ea65cfd56c4c50ab425b728cd.tar.bz2
samba-798fc28a6a1c660ea65cfd56c4c50ab425b728cd.zip
r24033: We need to be able to cope with packet_handler calling itself
recursively (This used to be commit b74797a31eae1c59c1a23934a3302987de9ab87c)
-rw-r--r--source3/lib/packet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/lib/packet.c b/source3/lib/packet.c
index d63ca2ef27..a3a33643ff 100644
--- a/source3/lib/packet.c
+++ b/source3/lib/packet.c
@@ -136,15 +136,16 @@ BOOL packet_handler(struct packet_context *ctx,
SMB_ASSERT(length <= ctx->in.length);
- data.data = ctx->in.data;
- data.length = length;
-
- *status = callback(&data, private_data);
+ data = data_blob(ctx->in.data, length);
memmove(ctx->in.data, ctx->in.data + length,
ctx->in.length - length);
ctx->in.length -= length;
+ *status = callback(&data, private_data);
+
+ data_blob_free(&data);
+
return True;
}