diff options
| author | Daniel P. Berrange <berrange@redhat.com> | 2017-10-20 10:18:39 +0100 |
|---|---|---|
| committer | Daniel P. Berrange <berrange@redhat.com> | 2017-11-07 14:10:20 +0000 |
| commit | 10a7b7e6fd9f250f0506568345d7b4d2ab52889d (patch) | |
| tree | 960eb875f5637140e8aa3c4889b66e5cbe16e0a3 /net/socket.c | |
| parent | 5853e92207193e967abf5e4c25b4a551c7604725 (diff) | |
| download | focaccia-qemu-10a7b7e6fd9f250f0506568345d7b4d2ab52889d.tar.gz focaccia-qemu-10a7b7e6fd9f250f0506568345d7b4d2ab52889d.zip | |
sockets: avoid leak of listen file descriptor
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. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'net/socket.c')
0 files changed, 0 insertions, 0 deletions