qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 38/53] qemu-img: Fix insignificant memleak


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PULL 38/53] qemu-img: Fix insignificant memleak
Date: Mon, 3 Nov 2014 11:50:41 +0000

From: Max Reitz <address@hidden>

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>
Reviewed-by: Kevin Wolf <address@hidden>
Reviewed-by: BenoƮt Canet <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 qemu-img.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qemu-img.c b/qemu-img.c
index c7b394a..66a7eb4 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2948,7 +2948,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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]