qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: bdrv_create(): don't leak cco.filename on error
@ 2012-10-17 19:45 Luiz Capitulino
  2012-10-18  7:15 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
  2012-10-18  9:46 ` [Qemu-devel] " Kevin Wolf
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Capitulino @ 2012-10-17 19:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Kevin Wolf


Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 block.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/block.c b/block.c
index 5e8184f..63bf768 100644
--- a/block.c
+++ b/block.c
@@ -379,7 +379,8 @@ int bdrv_create(BlockDriver *drv, const char* filename,
     };
 
     if (!drv->bdrv_create) {
-        return -ENOTSUP;
+        ret = -ENOTSUP;
+        goto out;
     }
 
     if (qemu_in_coroutine()) {
@@ -394,8 +395,9 @@ int bdrv_create(BlockDriver *drv, const char* filename,
     }
 
     ret = cco.ret;
-    g_free(cco.filename);
 
+out:
+    g_free(cco.filename);
     return ret;
 }
 
-- 
1.7.12.315.g682ce8b

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-18  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-17 19:45 [Qemu-devel] [PATCH] block: bdrv_create(): don't leak cco.filename on error Luiz Capitulino
2012-10-18  7:15 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-10-18  9:46 ` [Qemu-devel] " Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).