mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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>
This commit is contained in:
parent
f76b84a04b
commit
b3c33f9173
1 changed files with 1 additions and 1 deletions
2
ui/vnc.c
2
ui/vnc.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue