diff options
author | Daniel P. Berrange | 2017-10-20 11:18:39 +0200 |
---|---|---|
committer | Daniel P. Berrange | 2017-11-07 15:10:20 +0100 |
commit | 10a7b7e6fd9f250f0506568345d7b4d2ab52889d (patch) | |
tree | 960eb875f5637140e8aa3c4889b66e5cbe16e0a3 /linux-user/uname.c | |
parent | Merge remote-tracking branch 'remotes/pmaydell/tags/pull-cocoa-20171107' into... (diff) | |
download | qemu-10a7b7e6fd9f250f0506568345d7b4d2ab52889d.tar.gz qemu-10a7b7e6fd9f250f0506568345d7b4d2ab52889d.tar.xz 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 'linux-user/uname.c')
0 files changed, 0 insertions, 0 deletions