Commit c23c15d3 authored by Markus Armbruster's avatar Markus Armbruster Committed by Anthony Liguori
Browse files

acl: Fix acl_remove not to mess up the ACL



It leaks memory and fails to adjust qemu_acl member nentries.  Future
acl_add become confused: can misreport the position, and can silently
fail to add.

Cc: qemu-stable@nongnu.org
Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent cc69bda6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -168,6 +168,9 @@ int qemu_acl_remove(qemu_acl *acl,
        i++;
        if (strcmp(entry->match, match) == 0) {
            QTAILQ_REMOVE(&acl->entries, entry, next);
            acl->nentries--;
            g_free(entry->match);
            g_free(entry);
            return i;
        }
    }