diff options
author | Markus Armbruster | 2013-01-15 15:24:15 +0100 |
---|---|---|
committer | Anthony Liguori | 2013-01-16 01:25:41 +0100 |
commit | c23c15d30b901bb447cdcada96cae64c0046d146 (patch) | |
tree | 95aad50a067a49578ca3e2dc5dac5b54801cc3f3 | |
parent | sdl: Fix heap smash in sdl_zoom_rgb{16,32} for int > 32 bits (diff) | |
download | qemu-c23c15d30b901bb447cdcada96cae64c0046d146.tar.gz qemu-c23c15d30b901bb447cdcada96cae64c0046d146.tar.xz qemu-c23c15d30b901bb447cdcada96cae64c0046d146.zip |
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>
-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; } } |