]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
block: Fix leak of ignore_children in error path
authorFam Zheng <famz@redhat.com>
Thu, 15 Mar 2018 03:51:57 +0000 (11:51 +0800)
committerKevin Wolf <kwolf@redhat.com>
Mon, 19 Mar 2018 11:01:39 +0000 (12:01 +0100)
Reported-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c

diff --git a/block.c b/block.c
index e02d83b027c0760570ac25dacddb676eefa28aff..f7f9d8eca74d6b7a000d7299767d289fb4e59bc4 100644 (file)
--- a/block.c
+++ b/block.c
@@ -3679,12 +3679,12 @@ int bdrv_drop_intermediate(BlockDriverState *top, BlockDriverState *base,
         GSList *ignore_children = g_slist_prepend(NULL, c);
         bdrv_check_update_perm(base, NULL, c->perm, c->shared_perm,
                                ignore_children, &local_err);
+        g_slist_free(ignore_children);
         if (local_err) {
             ret = -EPERM;
             error_report_err(local_err);
             goto exit;
         }
-        g_slist_free(ignore_children);
 
         /* If so, update the backing file path in the image file */
         if (c->role->update_filename) {