summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/provision.c2
-rw-r--r--source4/param/pyparam.h2
-rw-r--r--source4/param/pyparam_util.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/source4/param/provision.c b/source4/param/provision.c
index 9191400f59..1e518ffe1f 100644
--- a/source4/param/provision.c
+++ b/source4/param/provision.c
@@ -189,7 +189,7 @@ NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
result->domaindn = talloc_strdup(mem_ctx, PyString_AsString(PyObject_GetAttrString(py_result, "domaindn")));
/* FIXME paths */
- result->lp_ctx = lp_from_py_object(PyObject_GetAttrString(py_result, "lp"));
+ result->lp_ctx = lp_from_py_object(result, PyObject_GetAttrString(py_result, "lp"));
result->samdb = PyLdb_AsLdbContext(PyObject_GetAttrString(py_result, "samdb"));
return NT_STATUS_OK;
diff --git a/source4/param/pyparam.h b/source4/param/pyparam.h
index 1a06730f38..4657dbafdf 100644
--- a/source4/param/pyparam.h
+++ b/source4/param/pyparam.h
@@ -22,7 +22,7 @@
#include "param/param.h"
-_PUBLIC_ struct loadparm_context *lp_from_py_object(PyObject *py_obj);
+_PUBLIC_ struct loadparm_context *lp_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj);
_PUBLIC_ struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx);
#endif /* _PYPARAM_H_ */
diff --git a/source4/param/pyparam_util.c b/source4/param/pyparam_util.c
index cc84395ea0..8136746f52 100644
--- a/source4/param/pyparam_util.c
+++ b/source4/param/pyparam_util.c
@@ -25,12 +25,12 @@
#define PyLoadparmContext_AsLoadparmContext(obj) py_talloc_get_type(obj, struct loadparm_context)
-_PUBLIC_ struct loadparm_context *lp_from_py_object(PyObject *py_obj)
+_PUBLIC_ struct loadparm_context *lp_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj)
{
struct loadparm_context *lp_ctx;
if (PyString_Check(py_obj)) {
- lp_ctx = loadparm_init(NULL);
+ lp_ctx = loadparm_init(mem_ctx);
if (!lp_load(lp_ctx, PyString_AsString(py_obj))) {
talloc_free(lp_ctx);
PyErr_Format(PyExc_RuntimeError, "Unable to load %s",
@@ -41,7 +41,7 @@ _PUBLIC_ struct loadparm_context *lp_from_py_object(PyObject *py_obj)
}
if (py_obj == Py_None) {
- lp_ctx = loadparm_init(NULL);
+ lp_ctx = loadparm_init(mem_ctx);
/* We're not checking that loading the file succeeded *on purpose */
lp_load_default(lp_ctx);
return lp_ctx;