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 | |
parent | cc69bda6c97a1c193348eb381f4bffdfd1c8a948 (diff) | |
download | qemu-c23c15d30b901bb447cdcada96cae64c0046d146.zip qemu-c23c15d30b901bb447cdcada96cae64c0046d146.tar.gz qemu-c23c15d30b901bb447cdcada96cae64c0046d146.tar.bz2 |
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')
-rw-r--r-- | util/acl.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; } } |