s3-epmapper: Fix allocation of data on the wrong context
authorSimo Sorce <idra@samba.org>
Thu, 24 Mar 2011 12:23:48 +0000 (08:23 -0400)
committerSimo Sorce <idra@samba.org>
Thu, 24 Mar 2011 18:57:12 +0000 (14:57 -0400)
p->mem_ctx is the short-lived per request context, while this data is long
lived, allocate on p instead.

source3/rpc_server/epmapper/srv_epmapper.c

index f7f3617f15d1629ed58c344a25f36dce3e3b75b9..b9ddd0583f161d70285d33e1235addf3aae3352f 100644 (file)
@@ -384,7 +384,7 @@ error_status_t _epm_Insert(struct pipes_struct *p,
        if (r->in.num_ents > 0) {
                struct dcesrv_ep_entry_list *el;
 
-               el = talloc_zero(p->mem_ctx, struct dcesrv_ep_entry_list);
+               el = talloc_zero(p, struct dcesrv_ep_entry_list);
                if (el == NULL) {
                        rc = EPMAPPER_STATUS_NO_MEMORY;
                        goto done;