From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2Wqf-0004Cu-GH for qemu-devel@nongnu.org; Thu, 15 Apr 2010 17:43:45 -0400 Received: from [140.186.70.92] (port=59187 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2Woi-0003Q4-76 for qemu-devel@nongnu.org; Thu, 15 Apr 2010 17:43:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2WoQ-00013J-CI for qemu-devel@nongnu.org; Thu, 15 Apr 2010 17:41:35 -0400 Received: from gerolde.archlinux.org ([66.211.214.132]:58494 helo=archlinux.org) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2WoP-00012h-Cg for qemu-devel@nongnu.org; Thu, 15 Apr 2010 17:41:26 -0400 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Thu, 15 Apr 2010 23:41:12 +0200 Message-Id: <1271367673-18975-1-git-send-email-thomas@archlinux.org> Subject: [Qemu-devel] [PATCH 1/2] qemu-char.c: Fix memory leaks in qemu_chr_open_pty when openpty fails List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Thomas=20B=C3=A4chler?= , kvm@vger.kernel.org --- qemu-char.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 05df971..d845572 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -986,6 +986,8 @@ static CharDriverState *qemu_chr_open_pty(QemuOpts *opts) s = qemu_mallocz(sizeof(PtyCharDriver)); if (openpty(&s->fd, &slave_fd, pty_name, NULL, NULL) < 0) { + qemu_free(chr); + qemu_free(s); return NULL; } -- 1.7.0.5