qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-char: do not leak QemuMutex when freeing a character device
@ 2016-01-15 15:17 Paolo Bonzini
  2016-01-15 15:20 ` Daniel P. Berrange
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2016-01-15 15:17 UTC (permalink / raw)
  To: qemu-devel

The leak is only apparent on Win32.  On POSIX platforms destroying a
mutex is not necessary.

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

diff --git a/qemu-char.c b/qemu-char.c
index 02b0318..c7b8699 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3967,6 +3967,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);
 }
 
-- 
2.5.0

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

* Re: [Qemu-devel] [PATCH] qemu-char: do not leak QemuMutex when freeing a character device
  2016-01-15 15:17 [Qemu-devel] [PATCH] qemu-char: do not leak QemuMutex when freeing a character device Paolo Bonzini
@ 2016-01-15 15:20 ` Daniel P. Berrange
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrange @ 2016-01-15 15:20 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Fri, Jan 15, 2016 at 04:17:01PM +0100, Paolo Bonzini wrote:
> The leak is only apparent on Win32.  On POSIX platforms destroying a
> mutex is not necessary.
> 
> Reported-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  qemu-char.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

> diff --git a/qemu-char.c b/qemu-char.c
> index 02b0318..c7b8699 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -3967,6 +3967,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);
>  }

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

end of thread, other threads:[~2016-01-15 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-15 15:17 [Qemu-devel] [PATCH] qemu-char: do not leak QemuMutex when freeing a character device Paolo Bonzini
2016-01-15 15:20 ` Daniel P. Berrange

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