[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH 2/2] vnc: avoid possible file handler leak
From: |
arei.gonglei |
Subject: |
[Qemu-trivial] [PATCH 2/2] vnc: avoid possible file handler leak |
Date: |
Wed, 11 Mar 2015 16:21:01 +0800 |
From: Gonglei <address@hidden>
vs->lsock may equal to 0, modify the check condition,
avoid possible vs->lsock leak.
Signed-off-by: Gonglei <address@hidden>
---
ui/vnc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 10a2724..259eca2 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3641,7 +3641,7 @@ void vnc_display_open(const char *id, Error **errp)
}
if (vs->lwebsock < 0) {
- if (vs->lsock) {
+ if (vs->lsock != -1) {
close(vs->lsock);
vs->lsock = -1;
}
--
1.7.12.4