From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REiUB-0001ah-Q2 for qemu-devel@nongnu.org; Fri, 14 Oct 2011 10:11:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1REiTz-0008Ph-S4 for qemu-devel@nongnu.org; Fri, 14 Oct 2011 10:11:43 -0400 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:45423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REiTz-0008PO-L7 for qemu-devel@nongnu.org; Fri, 14 Oct 2011 10:11:31 -0400 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p9EEBVjs022233 for ; Fri, 14 Oct 2011 14:11:31 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9EEBUo42359462 for ; Fri, 14 Oct 2011 15:11:30 +0100 Received: from d06av07.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9EEBTKS000473 for ; Fri, 14 Oct 2011 08:11:30 -0600 From: Stefan Hajnoczi Date: Fri, 14 Oct 2011 15:11:22 +0100 Message-Id: <1318601487-32419-3-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1318601487-32419-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1318601487-32419-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 2/7] 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: Stefan Weil , Anthony Liguori , Stefan Hajnoczi From: 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 Tested-by: Dongxu Wang Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- qemu-char.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 8bdbcfd..fb9e058 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.6.3