From 240ec86942c6efad5da9b762075971f66969b2f4 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Thu, 22 Jun 2006 21:29:21 +0000 Subject: r16476: Error in composite functions implemented the 'old way' (single event handler, no continue functions) need to report an error by means of state only. composite_error calls event handler function which frees the context and state structure. This fixes a segfault in some cases (caught it on modifyuser test). rafal (This used to be commit 9e800fd0cfda9e731905fc0f19781def5cdba89f) --- source4/libnet/userman.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c index 9c084eee48..cd12ece0e8 100644 --- a/source4/libnet/userman.c +++ b/source4/libnet/userman.c @@ -519,11 +519,13 @@ static NTSTATUS usermod_lookup(struct composite_context *c, and what if there's more than one rid resolved */ if (!s->lookupname.out.rids.count) { c->status = NT_STATUS_NO_SUCH_USER; - composite_error(c, c->status); + c->state = COMPOSITE_STATE_ERROR; + return c->status; } else if (!s->lookupname.out.rids.count > 1) { c->status = NT_STATUS_INVALID_ACCOUNT_NAME; - composite_error(c, c->status); + c->state = COMPOSITE_STATE_ERROR; + return c->status; } /* prepare the next rpc call */ -- cgit