r12014: free the irpc_request structure with the irpc_call_recv functions,
authorStefan Metzmacher <metze@samba.org>
Fri, 2 Dec 2005 07:30:34 +0000 (07:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:46:59 +0000 (13:46 -0500)
to match all other _recv functions we have

metze
(This used to be commit bd4f85ab5f60c7430ac88062fa6a9f6cffa9596f)

source4/lib/messaging/messaging.c
source4/scripting/ejs/smbcalls_rpc.c
source4/torture/local/irpc.c
source4/winbind/wb_async_helpers.c
source4/winbind/wb_dom_info.c

index c3d3ba78993b892de20beaac1481a875922774b3..06eed05404d20a5791c9700197c0c01571f335b0 100644 (file)
@@ -730,13 +730,18 @@ failed:
 */
 NTSTATUS irpc_call_recv(struct irpc_request *irpc)
 {
+       NTSTATUS status;
+
        NT_STATUS_HAVE_NO_MEMORY(irpc);
+
        while (!irpc->done) {
                if (event_loop_once(irpc->msg_ctx->event.ev) != 0) {
                        return NT_STATUS_CONNECTION_DISCONNECTED;
-               }               
+               }
        }
-       return irpc->status;
+       status = irpc->status;
+       talloc_free(irpc);
+       return status;
 }
 
 /*
@@ -750,9 +755,7 @@ NTSTATUS irpc_call(struct messaging_context *msg_ctx,
 {
        struct irpc_request *irpc = irpc_call_send(msg_ctx, server_id, 
                                                   table, callnum, r, mem_ctx);
-       NTSTATUS status = irpc_call_recv(irpc);
-       talloc_free(irpc);
-       return status;
+       return irpc_call_recv(irpc);
 }
 
 /*
index 4163896e71a1b570870b7d4d62acec1537a60673..c71a475a92ac46078de156876affadfcf3accaae 100644 (file)
@@ -248,7 +248,6 @@ static int ejs_irpc_call(int eid, struct MprVar *io,
                if (!NT_STATUS_IS_OK(status)) {
                        goto done;
                }
-               talloc_free(reqs[i]);
 
                /* add to the results array */
                output = mprGetProperty(io, "output", NULL);
index 861edc42fae3599943ed36c228501c421f1bfee0..71744ad2e82c6d11a20cfa7f117b6eb14afdc2a8 100644 (file)
@@ -154,7 +154,6 @@ static void irpc_callback(struct irpc_request *irpc)
                       r->in.in_data, *r->out.out_data, r->in.in_data+1);
        }
        (*pong_count)++;
-       talloc_free(irpc);
 }
 
 /*
index cfbfe5f74fb7215ba844cd257fc2cbe0f4542683..8efd19f96b3d3ad2872eee232e7dd9b8154d5a47 100644 (file)
@@ -141,7 +141,6 @@ static void finddcs_getdc(struct irpc_request *ireq)
                talloc_get_type(ireq->async.private, struct finddcs_state);
 
        state->ctx->status = irpc_call_recv(ireq);
-       talloc_free(ireq);
        if (!composite_is_ok(state->ctx)) return;
 
        state->dcs[0].name = talloc_steal(state->dcs, state->r.out.dcname);
index 5be28cc0557ea1477309bc2c71d8bfbcbdd7f8fb..4f27243511d32832d01413aa0a71f785cbb17ab3 100644 (file)
@@ -132,7 +132,6 @@ static void get_dom_info_recv_dcname(struct irpc_request *ireq)
 
 
        state->ctx->status = irpc_call_recv(ireq);
-       talloc_free(ireq);
        if (!composite_is_ok(state->ctx)) return;
 
        state->info->dc_name = talloc_steal(state->info, state->r.out.dcname);