summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-11-08 23:36:09 +0200
committerKamen Mazdrashki <kamenim@samba.org>2010-11-10 10:20:00 +0200
commit06b0596537e66ed928b24af059ada0472a375f3b (patch)
treee1fe7dc56828e50098c95888a293ab192f3d5938
parentad5a399d54fba103822ba9cbea4515d52eafd1fe (diff)
downloadsamba-06b0596537e66ed928b24af059ada0472a375f3b.tar.gz
samba-06b0596537e66ed928b24af059ada0472a375f3b.tar.bz2
samba-06b0596537e66ed928b24af059ada0472a375f3b.zip
s4-pydsdb-py_dsdb_get_oid_from_attid(): Avoid potential memory leak
in case py_ldb is not a valid LDB
-rw-r--r--source4/dsdb/pydsdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c
index 5bc3e66809..e270d7458b 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -245,14 +245,14 @@ static PyObject *py_dsdb_get_oid_from_attid(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "Oi", &py_ldb, &attid))
return NULL;
+ PyErr_LDB_OR_RAISE(py_ldb, ldb);
+
mem_ctx = talloc_new(NULL);
if (mem_ctx == NULL) {
PyErr_NoMemory();
return NULL;
}
- PyErr_LDB_OR_RAISE(py_ldb, ldb);
-
schema = dsdb_get_schema(ldb, NULL);
if (!schema) {