diff options
author | Gonglei <arei.gonglei@huawei.com> | 2015-03-11 16:21:01 +0800 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-03-12 08:22:12 +0100 |
commit | b3c33f91732ea32e7a8391c5e61c3fc02308d822 (patch) | |
tree | 233dff1c089c8b26294a3385d4911f5bcd494aa9 | |
parent | f76b84a04b75e98eee56e8dc277564d0fbb99018 (diff) | |
download | qemu-b3c33f91732ea32e7a8391c5e61c3fc02308d822.zip qemu-b3c33f91732ea32e7a8391c5e61c3fc02308d822.tar.gz qemu-b3c33f91732ea32e7a8391c5e61c3fc02308d822.tar.bz2 |
vnc: avoid possible file handler leak
vs->lsock may equal to 0, modify the check condition,
avoid possible vs->lsock leak.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | ui/vnc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3644,7 +3644,7 @@ void vnc_display_open(const char *id, Error **errp) if (vs->ws_enabled) { vs->lwebsock = inet_listen_opts(wsopts, 0, errp); if (vs->lwebsock < 0) { - if (vs->lsock) { + if (vs->lsock != -1) { close(vs->lsock); vs->lsock = -1; } |