summaryrefslogtreecommitdiff
path: root/source3/passdb/py_passdb.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-08-26 16:25:27 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-26 14:06:07 +0200
commit322b5253f44f301362cb428175b0f22f358d4931 (patch)
tree4d8a4265202072dba01869992a58e12fa6757880 /source3/passdb/py_passdb.c
parent8c466c14114f6f9fc1b731184067cbd134445ae5 (diff)
downloadsamba-322b5253f44f301362cb428175b0f22f358d4931.tar.gz
samba-322b5253f44f301362cb428175b0f22f358d4931.tar.bz2
samba-322b5253f44f301362cb428175b0f22f358d4931.zip
s3-passdb: Allocate talloc stackframe before calling pdb_get_group_sid()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/passdb/py_passdb.c')
-rw-r--r--source3/passdb/py_passdb.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c
index f1f138daa1..f02230fd01 100644
--- a/source3/passdb/py_passdb.c
+++ b/source3/passdb/py_passdb.c
@@ -567,16 +567,17 @@ static PyObject *py_samu_get_group_sid(PyObject *obj, void *closure)
struct dom_sid *copy_group_sid;
TALLOC_CTX *mem_ctx;
+ mem_ctx = talloc_stackframe();
+ if (mem_ctx == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
group_sid = pdb_get_group_sid(sam_acct);
if (group_sid == NULL) {
Py_RETURN_NONE;
}
- mem_ctx = talloc_new(NULL);
- if (mem_ctx == NULL) {
- PyErr_NoMemory();
- return NULL;
- }
copy_group_sid = dom_sid_dup(mem_ctx, group_sid);
if (copy_group_sid == NULL) {
PyErr_NoMemory();