ike-rekey: Correctly destroy colliding rekey task
Using DESTROY_IF() this way doesn't correctly check if the pointer
is set.
Fixes: 7ffeed01c0 ("ike-rekey: Remove collision task type checks")
This commit is contained in:
@@ -449,7 +449,10 @@ METHOD(ike_rekey_t, collide, bool,
|
|||||||
"ignore");
|
"ignore");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DESTROY_IF(&this->collision->public.task);
|
if (this->collision)
|
||||||
|
{
|
||||||
|
this->collision->public.task.destroy(&this->collision->public.task);
|
||||||
|
}
|
||||||
this->collision = rekey;
|
this->collision = rekey;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -478,7 +481,10 @@ static void cleanup(private_ike_rekey_t *this)
|
|||||||
cur_sa = charon->bus->get_sa(charon->bus);
|
cur_sa = charon->bus->get_sa(charon->bus);
|
||||||
DESTROY_IF(this->new_sa);
|
DESTROY_IF(this->new_sa);
|
||||||
charon->bus->set_sa(charon->bus, cur_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,
|
METHOD(task_t, migrate, void,
|
||||||
|
|||||||
Reference in New Issue
Block a user