[v2,08/13] qemu-char: don't leak opts on error

Submitted by Gerd Hoffmann on June 24, 2013, 6:39 a.m.

Details

Message ID 1372055996-4072-9-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann June 24, 2013, 6:39 a.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 qemu-char.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/qemu-char.c b/qemu-char.c
index 3e0044b..5751391 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3185,7 +3185,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) {