summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-11-11 15:29:35 +1100
committerAmitay Isaacs <amitay@samba.org>2011-11-11 12:04:33 +0100
commit29b5a95b1f85f1e7493fb6be4ea5eaf7931d9c23 (patch)
tree29168c00e2f277f87d34aa8eed2e5c9cd27717e1 /source3/passdb
parentc2eb036d3f25d7d4456400595aec8f8c8a0b1cb2 (diff)
downloadsamba-29b5a95b1f85f1e7493fb6be4ea5eaf7931d9c23.tar.gz
samba-29b5a95b1f85f1e7493fb6be4ea5eaf7931d9c23.tar.bz2
samba-29b5a95b1f85f1e7493fb6be4ea5eaf7931d9c23.zip
py_passdb: Cannot steal an item pointer from an array
Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Fri Nov 11 12:04:33 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/py_passdb.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c
index 0f71837900..de278399b1 100644
--- a/source3/passdb/py_passdb.c
+++ b/source3/passdb/py_passdb.c
@@ -2236,7 +2236,7 @@ static PyObject *py_pdb_enum_aliasmem(pytalloc_Object *self, PyObject *args)
struct pdb_methods *methods;
TALLOC_CTX *tframe;
PyObject *py_alias_sid;
- struct dom_sid *alias_sid, *member_sid;
+ struct dom_sid *alias_sid, *member_sid, *tmp_sid;
PyObject *py_member_list, *py_member_sid;
size_t num_members;
int i;
@@ -2271,10 +2271,15 @@ static PyObject *py_pdb_enum_aliasmem(pytalloc_Object *self, PyObject *args)
}
for(i=0; i<num_members; i++) {
- py_member_sid = pytalloc_steal(dom_sid_Type, &member_sid[i]);
- if (py_member_sid) {
- PyList_Append(py_member_list, py_member_sid);
+ py_member_sid = pytalloc_new(struct dom_sid, dom_sid_Type);
+ if (py_member_sid == NULL) {
+ PyErr_NoMemory();
+ talloc_free(tframe);
+ return NULL;
}
+ tmp_sid = pytalloc_get_ptr(py_member_sid);
+ *tmp_sid = member_sid[i];
+ PyList_Append(py_member_list, py_member_sid);
}
talloc_free(tframe);