[CRIU] [PATCH 15/18] net: don't call close for a negative value

Andrei Vagin avagin at openvz.org
Thu Nov 9 22:21:09 MSK 2017


From: Andrei Vagin <avagin at virtuozzo.com>

CID 178391 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
9. negative_returns: sk is passed to a parameter that cannot be negative.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/net.c b/criu/net.c
index 5f2c627da..7520439a8 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -2161,7 +2161,7 @@ int dump_net_ns(struct ns_id *ns)
 		if (!ret)
 			ret = dump_links(sk, ns, fds);
 
-		close(sk);
+		close_safe(&sk);
 
 		if (!ret)
 			ret = dump_ifaddr(fds);
-- 
2.13.6



More information about the CRIU mailing list