qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] ACL fixes
@ 2013-01-15 14:24 Markus Armbruster
  2013-01-15 14:24 ` [Qemu-devel] [PATCH 1/2] acl: Fix acl_remove not to mess up the ACL Markus Armbruster
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Markus Armbruster @ 2013-01-15 14:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, aliguori

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(-)

-- 
1.7.11.7

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 1/2] acl: Fix acl_remove not to mess up the ACL
  2013-01-15 14:24 [Qemu-devel] [PATCH 0/2] ACL fixes Markus Armbruster
@ 2013-01-15 14:24 ` Markus Armbruster
  2013-01-15 14:24 ` [Qemu-devel] [PATCH 2/2] acl: Free memory allocated with g_malloc() with g_free() Markus Armbruster
  2013-01-16  1:43 ` [Qemu-devel] [PATCH 0/2] ACL fixes Anthony Liguori
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2013-01-15 14:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, aliguori

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>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/2] acl: Free memory allocated with g_malloc() with g_free()
  2013-01-15 14:24 [Qemu-devel] [PATCH 0/2] ACL fixes Markus Armbruster
  2013-01-15 14:24 ` [Qemu-devel] [PATCH 1/2] acl: Fix acl_remove not to mess up the ACL Markus Armbruster
@ 2013-01-15 14:24 ` Markus Armbruster
  2013-01-16  1:43 ` [Qemu-devel] [PATCH 0/2] ACL fixes Anthony Liguori
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2013-01-15 14:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, aliguori


Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 util/acl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/acl.c b/util/acl.c
index 21b2205..a7f33ff 100644
--- a/util/acl.c
+++ b/util/acl.c
@@ -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;
 }
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] ACL fixes
  2013-01-15 14:24 [Qemu-devel] [PATCH 0/2] ACL fixes Markus Armbruster
  2013-01-15 14:24 ` [Qemu-devel] [PATCH 1/2] acl: Fix acl_remove not to mess up the ACL Markus Armbruster
  2013-01-15 14:24 ` [Qemu-devel] [PATCH 2/2] acl: Free memory allocated with g_malloc() with g_free() Markus Armbruster
@ 2013-01-16  1:43 ` Anthony Liguori
  2 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2013-01-16  1:43 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: pbonzini, aliguori

Thanks, applied.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-16  1:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 14:24 [Qemu-devel] [PATCH 0/2] ACL fixes Markus Armbruster
2013-01-15 14:24 ` [Qemu-devel] [PATCH 1/2] acl: Fix acl_remove not to mess up the ACL Markus Armbruster
2013-01-15 14:24 ` [Qemu-devel] [PATCH 2/2] acl: Free memory allocated with g_malloc() with g_free() Markus Armbruster
2013-01-16  1:43 ` [Qemu-devel] [PATCH 0/2] ACL fixes Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).