[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/6] qemu-img convert: Free @sn_opts in all error cases
From: |
Kevin Wolf |
Subject: |
[PULL 2/6] qemu-img convert: Free @sn_opts in all error cases |
Date: |
Tue, 3 Nov 2020 16:26:54 +0100 |
From: Tuguoyi <tu.guoyi@h3c.com>
@sn_opts is initialized at the beginning, so it should be deleted
after jumping to the lable 'fail_getopt'
Signed-off-by: Guoyi Tu <tu.guoyi@h3c.com>
Message-Id: <6ff1c5d372944494be3932274f75485d@h3c.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
qemu-img.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-img.c b/qemu-img.c
index a968c74cba..c2c56fc797 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2751,7 +2751,6 @@ out:
qemu_progress_end();
qemu_opts_del(opts);
qemu_opts_free(create_opts);
- qemu_opts_del(sn_opts);
qobject_unref(open_opts);
blk_unref(s.target);
if (s.src) {
@@ -2763,6 +2762,7 @@ out:
g_free(s.src_sectors);
g_free(s.src_alignment);
fail_getopt:
+ qemu_opts_del(sn_opts);
g_free(options);
return !!ret;
--
2.28.0
- [PULL 0/6] Block layer patches, Kevin Wolf, 2020/11/03
- [PULL 1/6] qmp: fix aio_poll() assertion failure on Windows, Kevin Wolf, 2020/11/03
- [PULL 2/6] qemu-img convert: Free @sn_opts in all error cases,
Kevin Wolf <=
- [PULL 4/6] iotests: Disable unsubscriptable-object in pylint, Kevin Wolf, 2020/11/03
- [PULL 3/6] iotests.py: Fix type check errors in wait_migration(), Kevin Wolf, 2020/11/03
- [PULL 5/6] iotests: Use Python 3 style super(), Kevin Wolf, 2020/11/03
- [PULL 6/6] block/vvfat: Fix bad printf format specifiers, Kevin Wolf, 2020/11/03
- Re: [PULL 0/6] Block layer patches, Peter Maydell, 2020/11/03