Merge pull request #300 from edk0/reject-free-fix

Fix a use-after-free introduced in #298
This commit is contained in:
Aaron Jones 2020-01-01 08:57:52 +00:00 committed by GitHub
commit b21c1403c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1135,8 +1135,10 @@ deactivate_conf(struct ConfItem *aconf, rb_dlink_node *ptr, time_t now)
del_from_resv_hash(aconf->host, aconf);
break;
}
if (aconf->lifetime != 0 && now < aconf->lifetime)
if (aconf->clients > 0 || (aconf->lifetime != 0 && now < aconf->lifetime))
{
aconf->status |= CONF_ILLEGAL;
}
else
{
if (aconf->lifetime != 0)