qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] sockets: avoid leak of listen file descriptor


From: Darren Kenny
Subject: Re: [Qemu-devel] [PATCH] sockets: avoid leak of listen file descriptor
Date: Fri, 20 Oct 2017 11:03:33 +0100
User-agent: NeoMutt/20171013

On Fri, Oct 20, 2017 at 10:54:31AM +0100, Daniel P. Berrange wrote:
On Fri, Oct 20, 2017 at 10:28:44AM +0100, Daniel P. Berrange wrote:
If we iterate over the full port range without successfully binding+listening
on the socket, we'll try the next address, whereupon we overwrite the slisten
file descriptor variable without closing it.

Rather than having two places where we open + close socket FDs on different
iterations of nested for loops, re-arrange the code to always open+close
within the same loop iteration.

Signed-off-by: Daniel P. Berrange <address@hidden>
---
 util/qemu-sockets.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

Self-NACK this has a bug too

Missed this...
Darren.



Regards,
Daniel
--
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]