diff options
author | Markus Armbruster <armbru@redhat.com> | 2013-01-15 15:24:15 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-01-15 18:25:41 -0600 |
commit | c23c15d30b901bb447cdcada96cae64c0046d146 (patch) | |
tree | 95aad50a067a49578ca3e2dc5dac5b54801cc3f3 /util/acl.c | |
parent | cc69bda6c97a1c193348eb381f4bffdfd1c8a948 (diff) |
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: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'util/acl.c')
-rw-r--r-- | util/acl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/acl.c b/util/acl.c index 81ac25599b..21b2205fa1 100644 --- a/util/acl.c +++ b/util/acl.c @@ -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; } } |