qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/2] acl: Fix acl_remove not to mess up the ACL


From: Markus Armbruster
Subject: [Qemu-devel] [PATCH 1/2] acl: Fix acl_remove not to mess up the ACL
Date: Tue, 15 Jan 2013 15:24:15 +0100

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: address@hidden
Signed-off-by: Markus Armbruster <address@hidden>
---
 util/acl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/util/acl.c b/util/acl.c
index 81ac255..21b2205 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;
         }
     }
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]