ACL fixes
cover ACL fixes
Markus Armbruster (2):
acl: Fix acl_remove not to mess up the ACL
acl: Free memory allocated with g_malloc() with g_free()
util/acl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.11.7
PATCH 1/2 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.
Signed-off-by Markus Armbruster <[email protected]>
--- util/acl.c | 3 +++ 1 file changed, 3 insertions(+)
util/acl.c +3 -0
@@ -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; } }
Signature · 1 line
1.7.11.7
PATCH 2/2 acl: Free memory allocated with g_malloc() with g_free()
In reply to Markus ArmbrusterSigned-off-by Markus Armbruster <[email protected]>
--- util/acl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
util/acl.c +2 -2
@@ -103,8 +103,8 @@ void qemu_acl_reset(qemu_acl *acl) acl->defaultDeny =1 ; QTAILQ_FOREACH_SAFE(entry, &acl->entries, next, next_entry) {QTAILQ_REMOVE (&acl->entries, entry, next); -free (entry->match); -free (entry); +g_free (entry->match); +g_free (entry); } acl->nentries =0 ; }
Signature · 1 line
1.7.11.7
Anthony Liguori
AppliedThanks, applied.
Regards,
Anthony Liguori