mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-03 00:00:24 -04:00
ike-rekey: Correctly destroy colliding rekey task
Using DESTROY_IF() this way doesn't correctly check if the pointer is set. Fixes: 7ffeed01c0d7 ("ike-rekey: Remove collision task type checks")
This commit is contained in:
parent
5eeeb894d1
commit
f2456376ae
@ -449,7 +449,10 @@ METHOD(ike_rekey_t, collide, bool,
|
||||
"ignore");
|
||||
break;
|
||||
}
|
||||
DESTROY_IF(&this->collision->public.task);
|
||||
if (this->collision)
|
||||
{
|
||||
this->collision->public.task.destroy(&this->collision->public.task);
|
||||
}
|
||||
this->collision = rekey;
|
||||
return TRUE;
|
||||
}
|
||||
@ -478,7 +481,10 @@ static void cleanup(private_ike_rekey_t *this)
|
||||
cur_sa = charon->bus->get_sa(charon->bus);
|
||||
DESTROY_IF(this->new_sa);
|
||||
charon->bus->set_sa(charon->bus, cur_sa);
|
||||
DESTROY_IF(&this->collision->public.task);
|
||||
if (this->collision)
|
||||
{
|
||||
this->collision->public.task.destroy(&this->collision->public.task);
|
||||
}
|
||||
}
|
||||
|
||||
METHOD(task_t, migrate, void,
|
||||
|
Loading…
x
Reference in New Issue
Block a user