[Qemu-devel] [PATCH] vnc: fix a qio-channel leak

Marc-André Lureau posted 1 patch 7 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170317092802.17973-1-marcandre.lureau@redhat.com
Test checkpatch passed
Test docker passed
Test s390x passed
ui/vnc.c | 1 +
1 file changed, 1 insertion(+)
[Qemu-devel] [PATCH] vnc: fix a qio-channel leak
Posted by Marc-André Lureau 7 years, 1 month ago
Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/vnc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui/vnc.c b/ui/vnc.c
index 8bfb1e0685..6e93b883b5 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3677,6 +3677,7 @@ static int vnc_display_listen_addr(VncDisplay *vd,
         qio_channel_set_name(QIO_CHANNEL(sioc), name);
         if (qio_channel_socket_listen_sync(
                 sioc, rawaddrs[i], listenerr == NULL ? &listenerr : NULL) < 0) {
+            object_unref(OBJECT(sioc));
             continue;
         }
         listening = true;
-- 
2.12.0.191.gc5d8de91d


Re: [Qemu-devel] [PATCH] vnc: fix a qio-channel leak
Posted by Daniel P. Berrange 7 years, 1 month ago
On Fri, Mar 17, 2017 at 01:28:02PM +0400, Marc-André Lureau wrote:
> Spotted by ASAN.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  ui/vnc.c | 1 +
>  1 file changed, 1 insertion(+)

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

> diff --git a/ui/vnc.c b/ui/vnc.c
> index 8bfb1e0685..6e93b883b5 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -3677,6 +3677,7 @@ static int vnc_display_listen_addr(VncDisplay *vd,
>          qio_channel_set_name(QIO_CHANNEL(sioc), name);
>          if (qio_channel_socket_listen_sync(
>                  sioc, rawaddrs[i], listenerr == NULL ? &listenerr : NULL) < 0) {
> +            object_unref(OBJECT(sioc));
>              continue;
>          }
>          listening = true;

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

Re: [Qemu-devel] [PATCH] vnc: fix a qio-channel leak
Posted by Philippe Mathieu-Daudé 7 years, 1 month ago
On 03/17/2017 07:14 AM, Daniel P. Berrange wrote:
> On Fri, Mar 17, 2017 at 01:28:02PM +0400, Marc-André Lureau wrote:
>> Spotted by ASAN.
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>>  ui/vnc.c | 1 +
>>  1 file changed, 1 insertion(+)
>
> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

>> diff --git a/ui/vnc.c b/ui/vnc.c
>> index 8bfb1e0685..6e93b883b5 100644
>> --- a/ui/vnc.c
>> +++ b/ui/vnc.c
>> @@ -3677,6 +3677,7 @@ static int vnc_display_listen_addr(VncDisplay *vd,
>>          qio_channel_set_name(QIO_CHANNEL(sioc), name);
>>          if (qio_channel_socket_listen_sync(
>>                  sioc, rawaddrs[i], listenerr == NULL ? &listenerr : NULL) < 0) {
>> +            object_unref(OBJECT(sioc));
>>              continue;
>>          }
>>          listening = true;
>
> Regards,
> Daniel
>