[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 3/7] qemu-img: Fix insignificant memleak
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v2 3/7] qemu-img: Fix insignificant memleak |
Date: |
Sat, 2 Aug 2014 01:49:17 +0200 |
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 4b6406b..0bd8fa5 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2808,7 +2808,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;
--
2.0.3