aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-22 13:09:42 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-10-24 15:46:10 +0200
commitebf4c54d4b24badc88a9f3e23f1540003e1f7cd7 (patch)
tree713aebcedb75b7b7f71f6794f8cdfc7ee6df0ab6 /qemu-char.c
parent3aef23d7d8ba559c6e74e931702c63b4c5e23dcd (diff)
char: use common error path in qmp_chardev_add
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022100951.19562-6-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 02adea4166..5e9684d61d 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -4752,8 +4752,7 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
chr = qemu_chr_find(id);
if (chr) {
error_setg(errp, "Chardev '%s' already exists", id);
- g_free(ret);
- return NULL;
+ goto out_error;
}
for (i = backends; i; i = i->next) {