A rather strange varient of talloc_unlink
authorAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 04:08:13 +0000 (14:08 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 05:15:37 +0000 (15:15 +1000)
A dcerpc request may have a reference from a still completing async
callback, but we now consider the request to be complete. We want to
lose the main parent, leaving just the reference, if any.

source4/librpc/rpc/dcerpc.c

index 13f649cdd9c9178ee2efc53a1f5035874336b69c..0ae56a470e500c6f8e7db82d8b8bec4208113278 100644 (file)
@@ -1144,7 +1144,7 @@ NTSTATUS dcerpc_request_recv(struct rpc_request *req,
        if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
                req->p->last_fault_code = req->fault_code;
        }
-       talloc_free(req);
+       talloc_unlink(talloc_parent(req), req);
        return status;
 }