mirror of https://github.com/xqemu/xqemu.git
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
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) {
|
if (vs->ws_enabled) {
|
||||||
vs->lwebsock = inet_listen_opts(wsopts, 0, errp);
|
vs->lwebsock = inet_listen_opts(wsopts, 0, errp);
|
||||||
if (vs->lwebsock < 0) {
|
if (vs->lwebsock < 0) {
|
||||||
if (vs->lsock) {
|
if (vs->lsock != -1) {
|
||||||
close(vs->lsock);
|
close(vs->lsock);
|
||||||
vs->lsock = -1;
|
vs->lsock = -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue