From 606ee8f5eadd79627216bbdde4da0337cb7d4360 Mon Sep 17 00:00:00 2001 From: Gonglei Date: Thu, 12 Feb 2015 09:57:20 +0800 Subject: monitor: Fix missing err = NULL in client_migrate_info() When SPICE isn't used, we either fail an assertion in error_set(), or leak an error object. Broken in commit b25d81b. Cc: Markus Armbruster Signed-off-by: Gonglei Reviewed-by: Markus Armbruster Signed-off-by: Luiz Capitulino --- monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index c3cc060b45..137d23fcc1 100644 --- a/monitor.c +++ b/monitor.c @@ -1095,12 +1095,13 @@ static int client_migrate_info(Monitor *mon, const QDict *qdict, const char *subject = qdict_get_try_str(qdict, "cert-subject"); int port = qdict_get_try_int(qdict, "port", -1); int tls_port = qdict_get_try_int(qdict, "tls-port", -1); - Error *err; + Error *err = NULL; int ret; if (strcmp(protocol, "spice") == 0) { if (!qemu_using_spice(&err)) { qerror_report_err(err); + error_free(err); return -1; } -- cgit v1.2.1