summaryrefslogtreecommitdiff
path: root/source4/lib/ldb-samba
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb-samba')
-rw-r--r--source4/lib/ldb-samba/pyldb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/ldb-samba/pyldb.c b/source4/lib/ldb-samba/pyldb.c
index 084afb7603..2b7b23739e 100644
--- a/source4/lib/ldb-samba/pyldb.c
+++ b/source4/lib/ldb-samba/pyldb.c
@@ -54,14 +54,14 @@ static PyObject *py_ldb_set_loadparm(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O", &py_lp_ctx))
return NULL;
- lp_ctx = lp_from_py_object(py_lp_ctx);
+ ldb = PyLdb_AsLdbContext(self);
+
+ lp_ctx = lp_from_py_object(ldb, py_lp_ctx);
if (lp_ctx == NULL) {
PyErr_SetString(PyExc_TypeError, "Expected loadparm object");
return NULL;
}
- ldb = PyLdb_AsLdbContext(self);
-
ldb_set_opaque(ldb, "loadparm", lp_ctx);
Py_RETURN_NONE;