if (acl)
return acl;
- acl = qemu_malloc(sizeof(*acl));
- acl->aclname = qemu_strdup(aclname);
+ acl = g_malloc(sizeof(*acl));
+ acl->aclname = g_strdup(aclname);
/* Deny by default, so there is no window of "open
* access" between QEMU starting, and the user setting
* up ACLs in the monitor */
acl->nentries = 0;
QTAILQ_INIT(&acl->entries);
- acls = qemu_realloc(acls, sizeof(*acls) * (nacls +1));
+ acls = g_realloc(acls, sizeof(*acls) * (nacls +1));
acls[nacls] = acl;
nacls++;
void qemu_acl_reset(qemu_acl *acl)
{
- qemu_acl_entry *entry;
+ qemu_acl_entry *entry, *next_entry;
/* Put back to deny by default, so there is no window
* of "open access" while the user re-initializes the
* access control list */
acl->defaultDeny = 1;
- QTAILQ_FOREACH(entry, &acl->entries, next) {
+ QTAILQ_FOREACH_SAFE(entry, &acl->entries, next, next_entry) {
QTAILQ_REMOVE(&acl->entries, entry, next);
free(entry->match);
free(entry);
{
qemu_acl_entry *entry;
- entry = qemu_malloc(sizeof(*entry));
- entry->match = qemu_strdup(match);
+ entry = g_malloc(sizeof(*entry));
+ entry->match = g_strdup(match);
entry->deny = deny;
QTAILQ_INSERT_TAIL(&acl->entries, entry, next);
return qemu_acl_append(acl, deny, match);
- entry = qemu_malloc(sizeof(*entry));
- entry->match = qemu_strdup(match);
+ entry = g_malloc(sizeof(*entry));
+ entry->match = g_strdup(match);
entry->deny = deny;
QTAILQ_FOREACH(tmp, &acl->entries, next) {