diff mbox

[PULL,15/15] qemu-char: do not leak QemuMutex when freeing a character device

Message ID 1452873871-138914-17-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini Jan. 15, 2016, 4:04 p.m. UTC
The leak is only apparent on Win32.  On POSIX platforms destroying a
mutex is not necessary.

Reported-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-char.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/qemu-char.c b/qemu-char.c
index 11caa56..e133f4f 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3972,6 +3972,7 @@  static void qemu_chr_free_common(CharDriverState *chr)
     if (chr->logfd != -1) {
         close(chr->logfd);
     }
+    qemu_mutex_destroy(&chr->chr_write_lock);
     g_free(chr);
 }