kernel-pfkey: Add sanity check when deleting policies

This commit is contained in:
Tobias Brunner
2013-07-24 16:17:22 +02:00
parent e5455e9413
commit e7d717cf01
@@ -2543,6 +2543,11 @@ METHOD(kernel_ipsec_t, del_policy, status_t,
first = FALSE;
}
enumerator->destroy(enumerator);
if (!to_remove)
{ /* sanity check */
this->mutex->unlock(this->mutex);
return SUCCESS;
}
policy->used_by->remove(policy->used_by, to_remove, NULL);
mapping = to_remove;