summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/spoolss_notify.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-01-29 10:59:14 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-01-29 10:59:14 +1100
commit9cc90f67b3fc4a16a2029a1cb1d98286ae598966 (patch)
tree7d579b4a7b377035907ae1fc3206d5f2573303ff /source4/torture/rpc/spoolss_notify.c
parentc16cd19bda30e6dc7be0540c4c70cbcaf3c7fe67 (diff)
parent87e933d886daa2abc30761e307be35170bbb6aeb (diff)
downloadsamba-9cc90f67b3fc4a16a2029a1cb1d98286ae598966.tar.gz
samba-9cc90f67b3fc4a16a2029a1cb1d98286ae598966.tar.bz2
samba-9cc90f67b3fc4a16a2029a1cb1d98286ae598966.zip
Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-abartlet
(This used to be commit 81a0a7967b8f659f1f35a7a25de469725417ab43)
Diffstat (limited to 'source4/torture/rpc/spoolss_notify.c')
-rw-r--r--source4/torture/rpc/spoolss_notify.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c
index 0065101447..96db7d1ec5 100644
--- a/source4/torture/rpc/spoolss_notify.c
+++ b/source4/torture/rpc/spoolss_notify.c
@@ -69,7 +69,8 @@ static NTSTATUS spoolss__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_
return NT_STATUS_OK;
}
-/* FIXME: What context does this belong in ? -- JRV20070903 */
+/* Note that received_packets are allocated in talloc_autofree_context(),
+ * because no other context appears to stay around long enough. */
static struct received_packet {
uint16_t opnum;
void *r;
@@ -82,9 +83,9 @@ static NTSTATUS spoolss__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_
uint16_t opnum = dce_call->pkt.u.request.opnum;
struct received_packet *rp;
- rp = talloc_zero(mem_ctx, struct received_packet);
+ rp = talloc_zero(talloc_autofree_context(), struct received_packet);
rp->opnum = opnum;
- rp->r = talloc_reference(mem_ctx, r);
+ rp->r = talloc_reference(rp, r);
DLIST_ADD_END(received_packets, rp, struct received_packet *);
@@ -195,6 +196,8 @@ static bool test_RFFPCNEx(struct torture_context *tctx,
const char *address;
struct interface *ifaces;
+ received_packets = NULL;
+
ntvfs_init(tctx->lp_ctx);
ZERO_STRUCT(q);
@@ -239,7 +242,6 @@ static bool test_RFFPCNEx(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status,
"unable to initialize DCE/RPC server");
-
r.in.flags = 0;
r.in.str = talloc_asprintf(tctx, "\\\\%s", address);
r.in.options = 0;
@@ -261,7 +263,6 @@ static bool test_RFFPCNEx(struct torture_context *tctx,
r.in.t1 = &t1;
r.in.handle = &handle;
-
status = dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "FFPCNEx failed");