aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/plugins/kernel_pfkey
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2008-11-11 09:56:47 +0000
committerTobias Brunner <tobias@strongswan.org>2008-11-11 09:56:47 +0000
commite7c27b4f3f2538045278dc1c20dbfa2da9c271e3 (patch)
tree8e8ef9c54abfb1f359275e9adb4bcc6339f88999 /src/charon/plugins/kernel_pfkey
parentea625fabf9ecde1acaa953f2ba0c1fae1af22c35 (diff)
downloadstrongswan-e7c27b4f3f2538045278dc1c20dbfa2da9c271e3.tar.bz2
strongswan-e7c27b4f3f2538045278dc1c20dbfa2da9c271e3.tar.xz
fixing a memory leak
Diffstat (limited to 'src/charon/plugins/kernel_pfkey')
-rw-r--r--src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c b/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
index 1f2c6516d..313642f58 100644
--- a/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
+++ b/src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
@@ -1879,6 +1879,7 @@ static bool add_bypass_policies(private_kernel_pfkey_ipsec_t *this)
{
int fd, family, port;
enumerator_t *sockets;
+ bool status = TRUE;
sockets = charon->socket->create_enumerator(charon->socket);
while (sockets->enumerate(sockets, &fd, &family, &port))
@@ -1910,17 +1911,20 @@ static bool add_bypass_policies(private_kernel_pfkey_ipsec_t *this)
{
DBG1(DBG_KNL, "unable to set IPSEC_POLICY on socket: %s",
strerror(errno));
- return FALSE;
+ status = FALSE;
+ break;
}
policy.sadb_x_policy_dir = IPSEC_DIR_INBOUND;
if (setsockopt(fd, sol, ipsec_policy, &policy, sizeof(policy)) < 0)
{
DBG1(DBG_KNL, "unable to set IPSEC_POLICY on socket: %s",
strerror(errno));
- return FALSE;
+ status = FALSE;
+ break;
}
}
- return TRUE;
+ sockets->destroy(sockets);
+ return status;
}
/*