From: "Thomas Bächler" <thomas@archlinux.org>
To: qemu-devel@nongnu.org
Cc: "Thomas Bächler" <thomas@archlinux.org>, kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH 1/2] qemu-char.c: Fix memory leaks in qemu_chr_open_pty when openpty fails
Date: Thu, 15 Apr 2010 23:41:12 +0200 [thread overview]
Message-ID: <1271367673-18975-1-git-send-email-thomas@archlinux.org> (raw)
---
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
next reply other threads:[~2010-04-15 21:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 21:41 Thomas Bächler [this message]
2010-04-15 21:41 ` [Qemu-devel] [PATCH 2/2] Add a 'screen' backend to qemu-char.c Thomas Bächler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1271367673-18975-1-git-send-email-thomas@archlinux.org \
--to=thomas@archlinux.org \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).