Received: from eggs.gnu.org ([2001:4830:134:3::10]:57314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPwIH-0004oO-P1 for qemu-devel@nongnu.org; Mon, 23 Feb 2015 11:55:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPwIA-0000sU-Gl for qemu-devel@nongnu.org; Mon, 23 Feb 2015 11:55:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPwIA-0000sJ-94 for qemu-devel@nongnu.org; Mon, 23 Feb 2015 11:55:34 -0500 From: Luiz Capitulino Date: Mon, 23 Feb 2015 11:55:25 -0500 Message-Id: <1424710526-21474-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1424710526-21474-1-git-send-email-lcapitulino@redhat.com> References: <1424710526-21474-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PULL 3/4] monitor: Fix missing err = NULL in client_migrate_info() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: qemu-devel@nongnu.org From: Gonglei 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(-) diff --git a/monitor.c b/monitor.c index c3cc060..137d23f 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; } -- 1.9.3