summaryrefslogtreecommitdiff
path: root/source4/auth/credentials
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-22 15:35:36 -0700
committerJelmer Vernooij <jelmer@samba.org>2010-09-22 17:48:23 -0700
commit3fea9df85a7d489b81e21a7a63f9e115de712d4c (patch)
tree07c31f8431ccc4e563922f1b7f56794e449e52c9 /source4/auth/credentials
parent63031a2a78cff19f1f17137adfbc85a4df05ae36 (diff)
downloadsamba-3fea9df85a7d489b81e21a7a63f9e115de712d4c.tar.gz
samba-3fea9df85a7d489b81e21a7a63f9e115de712d4c.tar.bz2
samba-3fea9df85a7d489b81e21a7a63f9e115de712d4c.zip
s4-param: Check type when converting python object to lp_ctx, fix some
memory leaks.
Diffstat (limited to 'source4/auth/credentials')
-rw-r--r--source4/auth/credentials/pycredentials.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c
index 7c860b041d..e1a74037ec 100644
--- a/source4/auth/credentials/pycredentials.c
+++ b/source4/auth/credentials/pycredentials.c
@@ -214,12 +214,14 @@ static PyObject *py_creds_guess(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
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;
cli_credentials_guess(creds, lp_ctx);
+ talloc_free(lp_ctx);
+
Py_RETURN_NONE;
}
@@ -235,11 +237,13 @@ static PyObject *py_creds_set_machine_account(py_talloc_Object *self, PyObject *
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
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;
status = cli_credentials_set_machine_account(creds, lp_ctx);
+ talloc_free(lp_ctx);
+
PyErr_NTSTATUS_IS_ERR_RAISE(status);
Py_RETURN_NONE;
@@ -288,6 +292,7 @@ static PyObject *py_creds_get_named_ccache(py_talloc_Object *self, PyObject *arg
ret = cli_credentials_get_named_ccache(creds, event_ctx, lp_ctx,
ccache_name, &ccc, &error_string);
+ talloc_free(lp_ctx);
if (ret == 0) {
talloc_steal(ccc, event_ctx);
return PyCredentialCacheContainer_from_ccache_container(ccc);