Diff for /qemu/acl.c between versions 1.1.1.3 and 1.1.1.4

version 1.1.1.3, 2018/04/24 18:55:56 version 1.1.1.4, 2018/04/24 19:17:00
Line 55  qemu_acl *qemu_acl_init(const char *acln Line 55  qemu_acl *qemu_acl_init(const char *acln
     if (acl)      if (acl)
         return acl;          return acl;
   
     acl = qemu_malloc(sizeof(*acl));      acl = g_malloc(sizeof(*acl));
     acl->aclname = qemu_strdup(aclname);      acl->aclname = g_strdup(aclname);
     /* Deny by default, so there is no window of "open      /* Deny by default, so there is no window of "open
      * access" between QEMU starting, and the user setting       * access" between QEMU starting, and the user setting
      * up ACLs in the monitor */       * up ACLs in the monitor */
Line 65  qemu_acl *qemu_acl_init(const char *acln Line 65  qemu_acl *qemu_acl_init(const char *acln
     acl->nentries = 0;      acl->nentries = 0;
     QTAILQ_INIT(&acl->entries);      QTAILQ_INIT(&acl->entries);
   
     acls = qemu_realloc(acls, sizeof(*acls) * (nacls +1));      acls = g_realloc(acls, sizeof(*acls) * (nacls +1));
     acls[nacls] = acl;      acls[nacls] = acl;
     nacls++;      nacls++;
   
Line 95  int qemu_acl_party_is_allowed(qemu_acl * Line 95  int qemu_acl_party_is_allowed(qemu_acl *
   
 void qemu_acl_reset(qemu_acl *acl)  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      /* Put back to deny by default, so there is no window
      * of "open access" while the user re-initializes the       * of "open access" while the user re-initializes the
      * access control list */       * access control list */
     acl->defaultDeny = 1;      acl->defaultDeny = 1;
     QTAILQ_FOREACH(entry, &acl->entries, next) {      QTAILQ_FOREACH_SAFE(entry, &acl->entries, next, next_entry) {
         QTAILQ_REMOVE(&acl->entries, entry, next);          QTAILQ_REMOVE(&acl->entries, entry, next);
         free(entry->match);          free(entry->match);
         free(entry);          free(entry);
Line 116  int qemu_acl_append(qemu_acl *acl, Line 116  int qemu_acl_append(qemu_acl *acl,
 {  {
     qemu_acl_entry *entry;      qemu_acl_entry *entry;
   
     entry = qemu_malloc(sizeof(*entry));      entry = g_malloc(sizeof(*entry));
     entry->match = qemu_strdup(match);      entry->match = g_strdup(match);
     entry->deny = deny;      entry->deny = deny;
   
     QTAILQ_INSERT_TAIL(&acl->entries, entry, next);      QTAILQ_INSERT_TAIL(&acl->entries, entry, next);
Line 142  int qemu_acl_insert(qemu_acl *acl, Line 142  int qemu_acl_insert(qemu_acl *acl,
         return qemu_acl_append(acl, deny, match);          return qemu_acl_append(acl, deny, match);
   
   
     entry = qemu_malloc(sizeof(*entry));      entry = g_malloc(sizeof(*entry));
     entry->match = qemu_strdup(match);      entry->match = g_strdup(match);
     entry->deny = deny;      entry->deny = deny;
   
     QTAILQ_FOREACH(tmp, &acl->entries, next) {      QTAILQ_FOREACH(tmp, &acl->entries, next) {

Removed from v.1.1.1.3  
changed lines
  Added in v.1.1.1.4


unix.superglobalmegacorp.com