fixed a memory error in change notify handling in gentest
authorAndrew Tridgell <tridge@samba.org>
Tue, 23 Sep 2008 05:20:24 +0000 (15:20 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 23 Sep 2008 05:20:24 +0000 (15:20 +1000)
source4/torture/gentest.c

index af5a95e7517f8f8d0416f5ebce8b4deaf2a9555a..1bb7c4debd128d0702c4ca338352716a0887876c 100644 (file)
@@ -2907,12 +2907,11 @@ static int run_test(struct event_context *ev, struct loadparm_context *lp_ctx)
                current_op.opnum = op;
                current_op.name = gen_ops[which_op].name;
                current_op.status = NT_STATUS_OK;
+               talloc_free(current_op.mem_ctx);
                current_op.mem_ctx = talloc_named(NULL, 0, "%s", current_op.name);
 
                ret = gen_ops[which_op].handler(instance);
 
-               talloc_free(current_op.mem_ctx);
-
                gen_ops[which_op].count++;
                if (NT_STATUS_IS_OK(current_op.status)) {
                        gen_ops[which_op].success_count++;