[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 5/6] block/qapi: Plug memory leak on query-block erro
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 5/6] block/qapi: Plug memory leak on query-block error path |
Date: |
Wed, 25 Nov 2015 15:10:23 +0100 |
From: Markus Armbruster <address@hidden>
Spotted by Coverity.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qapi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/block/qapi.c b/block/qapi.c
index d20262d..267f147 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -436,7 +436,9 @@ BlockInfoList *qmp_query_block(Error **errp)
bdrv_query_info(blk, &info->value, &local_err);
if (local_err) {
error_propagate(errp, local_err);
- goto err;
+ g_free(info);
+ qapi_free_BlockInfoList(head);
+ return NULL;
}
*p_next = info;
@@ -444,10 +446,6 @@ BlockInfoList *qmp_query_block(Error **errp)
}
return head;
-
- err:
- qapi_free_BlockInfoList(head);
- return NULL;
}
BlockStatsList *qmp_query_blockstats(bool has_query_nodes,
--
1.8.3.1
- [Qemu-block] [PULL 0/6] Block patches for 2.5.0-rc2, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 2/6] test-aio: Fix event notifier cleanup, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 4/6] raw-posix.c: Make GetBSDPath() handle caching options, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 3/6] nand: fix flash erase when oob is in memory, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 5/6] block/qapi: Plug memory leak on query-block error path,
Kevin Wolf <=
- [Qemu-block] [PULL 1/6] tests/Makefile: Add more dependencies for test-timed-average, Kevin Wolf, 2015/11/25
- [Qemu-block] [PULL 6/6] qemu-iotests: Add -nographic when starting QEMU in 119 and 120, Kevin Wolf, 2015/11/25
- Re: [Qemu-block] [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2, Peter Maydell, 2015/11/25