All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] qemu-char.c: Fix memory leaks in qemu_chr_open_pty when openpty fails
@ 2010-04-15 21:41 ` Thomas Bächler
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Bächler @ 2010-04-15 21:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: kvm, Thomas Bächler

---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-15 21:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-15 21:41 [PATCH 1/2] qemu-char.c: Fix memory leaks in qemu_chr_open_pty when openpty fails Thomas Bächler
2010-04-15 21:41 ` [Qemu-devel] " Thomas Bächler
2010-04-15 21:41 ` [PATCH 2/2] Add a 'screen' backend to qemu-char.c Thomas Bächler
2010-04-15 21:41   ` [Qemu-devel] " Thomas Bächler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.