aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
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) {