qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH] qcow2: fix two memory leaks in q


From: Max Reitz
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] qcow2: fix two memory leaks in qcow2_open error code path
Date: Fri, 28 Mar 2014 23:26:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 28.03.2014 18:38, Prasad Joshi wrote:
Signed-off-by: Prasad Joshi <address@hidden>
---
  block/qcow2.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/block/qcow2.c b/block/qcow2.c
index b9dc960..10eccf9 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -506,6 +506,7 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, 
int flags,
                                     s->incompatible_features &
                                     ~QCOW2_INCOMPAT_MASK);
          ret = -ENOTSUP;
+        g_free(feature_table);
          goto fail;
      }
@@ -745,6 +746,9 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags,
      if (s->l2_table_cache) {
          qcow2_cache_destroy(bs, s->l2_table_cache);
      }
+    if (s->refcount_block_cache) {
+        qcow2_cache_destroy(bs, s->refcount_block_cache);
+    }
      g_free(s->cluster_cache);
      qemu_vfree(s->cluster_data);
      return ret;

Reviewed-by: Max Reitz <address@hidden>



reply via email to

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