naccyde / rpms / iproute

Forked from rpms/iproute 9 months ago
Clone

Blame SOURCES/0078-tc-em_ipset-Don-t-leak-sockfd-on-error-path.patch

36cfb7
From d28ee4b622ad9fa10a81d88bb6b5ded02c085acd Mon Sep 17 00:00:00 2001
36cfb7
From: Andrea Claudi <aclaudi@redhat.com>
36cfb7
Date: Mon, 29 Apr 2019 20:07:22 +0200
36cfb7
Subject: [PATCH] tc/em_ipset: Don't leak sockfd on error path
36cfb7
36cfb7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
36cfb7
Upstream Status: iproute2.git commit 3e587d9f43891
36cfb7
36cfb7
commit 3e587d9f438910df6c1751c45fd898cec1477ae6
36cfb7
Author: Phil Sutter <phil@nwl.cc>
36cfb7
Date:   Thu Aug 17 19:09:31 2017 +0200
36cfb7
36cfb7
    tc/em_ipset: Don't leak sockfd on error path
36cfb7
36cfb7
    Signed-off-by: Phil Sutter <phil@nwl.cc>
36cfb7
---
36cfb7
 tc/em_ipset.c | 1 +
36cfb7
 1 file changed, 1 insertion(+)
36cfb7
36cfb7
diff --git a/tc/em_ipset.c b/tc/em_ipset.c
36cfb7
index fab975f5ea563..b59756515d239 100644
36cfb7
--- a/tc/em_ipset.c
36cfb7
+++ b/tc/em_ipset.c
36cfb7
@@ -84,6 +84,7 @@ static int get_version(unsigned int *version)
36cfb7
 	res = getsockopt(sockfd, SOL_IP, SO_IP_SET, &req_version, &size);
36cfb7
 	if (res != 0) {
36cfb7
 		perror("xt_set getsockopt");
36cfb7
+		close(sockfd);
36cfb7
 		return -1;
36cfb7
 	}
36cfb7
 
36cfb7
-- 
e138d9
2.21.0
36cfb7