[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 3/7] qemu-img: Fix insignificant memleak
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v4 3/7] qemu-img: Fix insignificant memleak |
Date: |
Mon, 27 Oct 2014 11:12:52 +0100 |
As soon as options is set in img_amend(), it needs to be freed before
the function returns. This leak is rather insignificant, as qemu-img
will exit subsequently anyway, but there's no point in not fixing it.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
---
qemu-img.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/qemu-img.c b/qemu-img.c
index 9ec2c28..a60da8c 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2847,7 +2847,9 @@ static int img_amend(int argc, char **argv)
}
if (optind != argc - 1) {
- error_exit("Expecting one image file name");
+ error_report("Expecting one image file name");
+ ret = -1;
+ goto out;
}
flags = BDRV_O_FLAGS | BDRV_O_RDWR;
--
1.9.3
- [Qemu-devel] [PATCH v4 0/7] block/qcow2: Improve zero cluster expansion, Max Reitz, 2014/10/27
- [Qemu-devel] [PATCH v4 1/7] block: Add status callback to bdrv_amend_options(), Max Reitz, 2014/10/27
- [Qemu-devel] [PATCH v4 2/7] qemu-img: Add progress output for amend, Max Reitz, 2014/10/27
- [Qemu-devel] [PATCH v4 3/7] qemu-img: Fix insignificant memleak,
Max Reitz <=
- [Qemu-devel] [PATCH v4 4/7] block/qcow2: Implement status CB for amend, Max Reitz, 2014/10/27
- [Qemu-devel] [PATCH v4 5/7] block/qcow2: Make get_refcount() global, Max Reitz, 2014/10/27
- [Qemu-devel] [PATCH v4 6/7] block/qcow2: Simplify shared L2 handling in amend, Max Reitz, 2014/10/27
- [Qemu-devel] [PATCH v4 7/7] iotests: Expand test 061, Max Reitz, 2014/10/27
- Re: [Qemu-devel] [PATCH v4 0/7] block/qcow2: Improve zero cluster expansion, Kevin Wolf, 2014/10/28
- Re: [Qemu-devel] [PATCH v4 0/7] block/qcow2: Improve zero cluster expansion, Stefan Hajnoczi, 2014/10/29