qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/9] l2tpv3: fix fd leak


From: arei.gonglei
Subject: [Qemu-devel] [PATCH 1/9] l2tpv3: fix fd leak
Date: Sat, 15 Nov 2014 18:06:40 +0800

From: Gonglei <address@hidden>

In this false branch, fd will leak when it is zero.
Change the testing condition.

Signed-off-by: Gonglei <address@hidden>
---
 net/l2tpv3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 528d95b..b2b0fc0 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -746,7 +746,7 @@ int net_init_l2tpv3(const NetClientOptions *opts,
     return 0;
 outerr:
     qemu_del_net_client(nc);
-    if (fd > 0) {
+    if (fd != -1) {
         close(fd);
     }
     if (result) {
-- 
1.7.12.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]