s4: COM: Remove talloc_autofree_context() from (unused) COM code.
[sfrench/samba-autobuild/.git] / source4 / lib / com / tables.c
index f56e1c3f1887671ff05c20cf79e2b8ea4d392c99..e1f93bcae59aa34fe8b0d62f02ea2d7a73d34cc1 100644 (file)
@@ -69,6 +69,7 @@ static struct IUnknown *get_com_class_so(TALLOC_CTX *mem_ctx, const struct GUID
        f = dlsym(mod, "get_class_object");
 
        if (!f) {
+               dlclose(mod);
                return NULL;
        }
 
@@ -95,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);