summaryrefslogtreecommitdiff
path: root/source4/auth/pyauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/auth/pyauth.c')
-rw-r--r--source4/auth/pyauth.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/auth/pyauth.c b/source4/auth/pyauth.c
index dff696334c..a66411bb4a 100644
--- a/source4/auth/pyauth.c
+++ b/source4/auth/pyauth.c
@@ -46,12 +46,14 @@ static PyObject *py_system_session(PyObject *module, PyObject *args)
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
return NULL;
- lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: Leaks memory */
+ lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx);
if (lp_ctx == NULL)
return NULL;
session = system_session(lp_ctx);
+ talloc_free(lp_ctx);
+
return PyAuthSession_FromSession(session);
}
@@ -66,13 +68,15 @@ static PyObject *py_admin_session(PyObject *module, PyObject *args)
if (!PyArg_ParseTuple(args, "OO", &py_lp_ctx, &py_sid))
return NULL;
- lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
+ lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx);
if (lp_ctx == NULL)
return NULL;
domain_sid = dom_sid_parse_talloc(NULL, PyString_AsString(py_sid));
session = admin_session(NULL, lp_ctx, domain_sid);
+ talloc_free(lp_ctx);
+
return PyAuthSession_FromSession(session);
}