summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-07-24 12:00:21 -0700
committerJeremy Allison <jra@samba.org>2017-07-26 21:35:21 +0200
commitfe2ac3e304201d18ca15d388b622a4f15f72ad0a (patch)
treeafcbffa95aac93a541b106a3ca095b3c23d395fe /source4/lib
parent1c1fce74142f1ba982fee045cdb72938faabe5d5 (diff)
downloadsamba-fe2ac3e304201d18ca15d388b622a4f15f72ad0a.tar.gz
s4: COM: Remove talloc_autofree_context() from (unused) COM code.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12932 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/com/classes/simple.c4
-rw-r--r--source4/lib/com/com.h3
-rw-r--r--source4/lib/com/dcom/tables.c10
-rw-r--r--source4/lib/com/tables.c6
-rw-r--r--source4/lib/wmi/wbemdata.c4
5 files changed, 16 insertions, 11 deletions
diff --git a/source4/lib/com/classes/simple.c b/source4/lib/com/classes/simple.c
index 28f5d848de5..7d0573372e3 100644
--- a/source4/lib/com/classes/simple.c
+++ b/source4/lib/com/classes/simple.c
@@ -110,7 +110,7 @@ static struct IStream_vtable simple_IStream_vtable = {
NTSTATUS com_simple_init(TALLOC_CTX *ctx)
{
struct GUID clsid;
- struct IUnknown *class_object = talloc(talloc_autofree_context(), struct IUnknown);
+ struct IUnknown *class_object = talloc(ctx, struct IUnknown);
class_object->ctx = NULL;
class_object->object_data = NULL;
@@ -120,5 +120,5 @@ NTSTATUS com_simple_init(TALLOC_CTX *ctx)
GUID_from_string(COM_ICLASSFACTORY_UUID, &simple_classobject_vtable.iid);
GUID_from_string(COM_ISTREAM_UUID, &simple_IStream_vtable.iid);
- return com_register_running_class(&clsid, PROGID_SIMPLE, class_object);
+ return com_register_running_class(ctx, &clsid, PROGID_SIMPLE, class_object);
}
diff --git a/source4/lib/com/com.h b/source4/lib/com/com.h
index 82d10daf4fd..e6be3114678 100644
--- a/source4/lib/com/com.h
+++ b/source4/lib/com/com.h
@@ -21,6 +21,7 @@
#define __SAMBA_COM_H__
#include "librpc/gen_ndr/misc.h"
+#include "lib/talloc/talloc.h"
struct com_context;
struct tevent_context;
@@ -38,7 +39,7 @@ struct com_context
};
struct IUnknown *com_class_by_clsid(struct com_context *ctx, const struct GUID *clsid);
-NTSTATUS com_register_running_class(struct GUID *clsid, const char *progid, struct IUnknown *p);
+NTSTATUS com_register_running_class(TALLOC_CTX *ctx, struct GUID *clsid, const char *progid, struct IUnknown *p);
struct dcom_interface_p *dcom_get_local_iface_p(struct GUID *ipid);
diff --git a/source4/lib/com/dcom/tables.c b/source4/lib/com/dcom/tables.c
index f94aa879253..7f745c1d479 100644
--- a/source4/lib/com/dcom/tables.c
+++ b/source4/lib/com/dcom/tables.c
@@ -29,9 +29,10 @@ static struct dcom_proxy {
struct dcom_proxy *prev, *next;
} *proxies = NULL;
-NTSTATUS dcom_register_proxy(struct IUnknown_vtable *proxy_vtable)
+NTSTATUS dcom_register_proxy(TALLOC_CTX *ctx,
+ struct IUnknown_vtable *proxy_vtable)
{
- struct dcom_proxy *proxy = talloc(talloc_autofree_context(), struct dcom_proxy);
+ struct dcom_proxy *proxy = talloc(ctx, struct dcom_proxy);
proxy->vtable = proxy_vtable;
DLIST_ADD(proxies, proxy);
@@ -57,9 +58,10 @@ static struct dcom_marshal {
struct dcom_marshal *prev, *next;
} *marshals = NULL;
-NTSTATUS dcom_register_marshal(struct GUID *clsid, marshal_fn marshal, unmarshal_fn unmarshal)
+NTSTATUS dcom_register_marshal(TALLOC_CTX *ctx,
+ struct GUID *clsid, marshal_fn marshal, unmarshal_fn unmarshal)
{
- struct dcom_marshal *p = talloc(talloc_autofree_context(), struct dcom_marshal);
+ struct dcom_marshal *p = talloc(ctx, struct dcom_marshal);
p->clsid = *clsid;
p->marshal = marshal;
diff --git a/source4/lib/com/tables.c b/source4/lib/com/tables.c
index 842067e8a54..e1f93bcae59 100644
--- a/source4/lib/com/tables.c
+++ b/source4/lib/com/tables.c
@@ -96,9 +96,11 @@ struct IUnknown *com_class_by_clsid(struct com_context *ctx, const struct GUID *
return NULL;
}
-NTSTATUS com_register_running_class(struct GUID *clsid, const char *progid, struct IUnknown *p)
+NTSTATUS com_register_running_class(TALLOC_CTX *ctx,
+ struct GUID *clsid, const char *progid, struct IUnknown *p)
{
- struct com_class *l = talloc_zero(running_classes?running_classes:talloc_autofree_context(), struct com_class);
+ struct com_class *l = talloc_zero(running_classes?
+ running_classes : ctx, struct com_class);
l->clsid = *clsid;
l->progid = talloc_strdup(l, progid);
diff --git a/source4/lib/wmi/wbemdata.c b/source4/lib/wmi/wbemdata.c
index 2aeda01a50e..df98da43a2a 100644
--- a/source4/lib/wmi/wbemdata.c
+++ b/source4/lib/wmi/wbemdata.c
@@ -432,11 +432,11 @@ struct composite_context *dcom_proxy_IEnumWbemClassObject_Release_send(struct IU
return c;
}
-NTSTATUS dcom_proxy_IWbemClassObject_init(void)
+NTSTATUS dcom_proxy_IWbemClassObject_init(TALLOC_CTX *ctx)
{
struct GUID clsid;
GUID_from_string("4590f812-1d3a-11d0-891f-00aa004b2e24", &clsid);
- dcom_register_marshal(&clsid, marshal, unmarshal);
+ dcom_register_marshal(ctx, &clsid, marshal, unmarshal);
#if 0
struct IEnumWbemClassObject_vtable *proxy_vtable;