Fix xspy_get_permissions -- you can't increment the perms pointer when

iterating and expect to be able to free that pointer afterwards.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2006-05-23 16:14:03 +01:00
1 parent c9d2f9fc59
commit 8b8e97bb5b
1 file changed
+6 -5
+6 -5
View File
@@ -272,11 +272,12 @@ static PyObject *xspy_get_permissions(XsHandle *self, PyObject *args)
if (perms) {
PyObject *val = PyList_New(perms_n);
for (i = 0; i < perms_n; i++, perms++) {
PyObject *p = Py_BuildValue("{s:i,s:i,s:i}",
"dom", perms->id,
"read", perms->perms & XS_PERM_READ,
"write",perms->perms & XS_PERM_WRITE);
for (i = 0; i < perms_n; i++) {
PyObject *p =
Py_BuildValue("{s:i,s:i,s:i}",
"dom", perms[i].id,
"read", perms[i].perms & XS_PERM_READ,
"write", perms[i].perms & XS_PERM_WRITE);
PyList_SetItem(val, i, p);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.