summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:28 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:28 +0930
commit99272331c60afa900852d996196b434ecd897287 (patch)
treeb2ad6311ed1dd0a791171c11a181f762dc607d83 /source3
parent51ec59db10306fd90211c237fd672acf3ab3304a (diff)
downloadsamba-99272331c60afa900852d996196b434ecd897287.tar.gz
samba-99272331c60afa900852d996196b434ecd897287.tar.bz2
samba-99272331c60afa900852d996196b434ecd897287.zip
source3/passdb/py_passdb.c: don't steal from talloc_stackframe().
If you want a stack-style allocation, use talloc_stackframe(). If you don't, don't use it. In particular, talloc_stackframe() here is actually inside a pool, and stealing from pools is a bad idea. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/py_passdb.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c
index 194a7d47a8..39db980933 100644
--- a/source3/passdb/py_passdb.c
+++ b/source3/passdb/py_passdb.c
@@ -560,34 +560,21 @@ static int py_samu_set_user_sid(PyObject *obj, PyObject *value, void *closure)
static PyObject *py_samu_get_group_sid(PyObject *obj, void *closure)
{
struct samu *sam_acct = (struct samu *)pytalloc_get_ptr(obj);
- PyObject *py_group_sid;
const struct dom_sid *group_sid;
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;
}
- copy_group_sid = dom_sid_dup(mem_ctx, group_sid);
+ copy_group_sid = dom_sid_dup(NULL, group_sid);
if (copy_group_sid == NULL) {
PyErr_NoMemory();
- talloc_free(mem_ctx);
return NULL;
}
- py_group_sid = pytalloc_steal(dom_sid_Type, copy_group_sid);
-
- talloc_free(mem_ctx);
-
- return py_group_sid;
+ return pytalloc_steal(dom_sid_Type, copy_group_sid);
}
static int py_samu_set_group_sid(PyObject *obj, PyObject *value, void *closure)