From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RC39T-0001TW-Jb for qemu-devel@nongnu.org; Fri, 07 Oct 2011 01:39:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RC39S-0003XN-Ll for qemu-devel@nongnu.org; Fri, 07 Oct 2011 01:39:19 -0400 From: Stefan Weil Date: Fri, 7 Oct 2011 07:38:46 +0200 Message-Id: <1317965926-1696-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH] qemu-char: Fix use of free() instead of g_free() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Stefan Weil cppcheck reported these errors: qemu-char.c:1667: error: Mismatching allocation and deallocation: s qemu-char.c:1668: error: Mismatching allocation and deallocation: chr qemu-char.c:1769: error: Mismatching allocation and deallocation: s qemu-char.c:1770: error: Mismatching allocation and deallocation: chr Signed-off-by: Stefan Weil --- qemu-char.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 09d2309..e1b2b87 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1664,8 +1664,8 @@ static int qemu_chr_open_win(QemuOpts *opts, CharDriverState **_chr) chr->chr_close = win_chr_close; if (win_chr_init(chr, filename) < 0) { - free(s); - free(chr); + g_free(s); + g_free(chr); return -EIO; } qemu_chr_generic_open(chr); @@ -1766,8 +1766,8 @@ static int qemu_chr_open_win_pipe(QemuOpts *opts, CharDriverState **_chr) chr->chr_close = win_chr_close; if (win_chr_pipe_init(chr, filename) < 0) { - free(s); - free(chr); + g_free(s); + g_free(chr); return -EIO; } qemu_chr_generic_open(chr); -- 1.7.2.5