diff options
author | Gonglei <arei.gonglei@huawei.com> | 2015-02-12 09:57:20 +0800 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2015-02-23 10:59:38 -0500 |
commit | 606ee8f5eadd79627216bbdde4da0337cb7d4360 (patch) | |
tree | edb4d3dd7013428d3bd000c146c77655d6f7b060 | |
parent | 438e8289d7746188f0684313d25d38d2a77747c9 (diff) |
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 <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r-- | monitor.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |