Skip to content

Commit

Permalink
vnc: avoid possible file handler leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gongleiarei authored and kraxel committed Mar 12, 2015
1 parent f76b84a commit b3c33f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/vnc.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit b3c33f9

Please sign in to comment.