Patchwork [PULL,08/14] qemu-char: don't leak opts on error

login
register
mail settings
Submitter Michael Tokarev
Date June 28, 2013, 6:17 p.m.
Message ID <1372443465-22384-9-git-send-email-mjt@msgid.tls.msk.ru>
Download mbox | patch
Permalink /patch/255499/
State New
Headers show

Comments

Michael Tokarev - June 28, 2013, 6:17 p.m.
From: Gerd Hoffmann <kraxel@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-char.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/qemu-char.c b/qemu-char.c
index 371f630..0cda56c 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3178,7 +3178,7 @@  CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts,
     if (i == NULL) {
         error_setg(errp, "chardev: backend \"%s\" not found",
                    qemu_opt_get(opts, "backend"));
-        return NULL;
+        goto err;
     }
 
     if (!cd->open) {