child-delete: Correctly maintain allocated reqid when recreating CHILD_SA

The old CHILD_SA is destroyed even before the new task is queued, this
makes sure we always maintain a reference to the reqid.
This commit is contained in:
Tobias Brunner
2023-11-13 12:02:11 +01:00
parent c2a4c8e38a
commit c923022733
+5 -1
View File
@@ -366,7 +366,7 @@ static status_t destroy_and_reestablish(private_child_delete_t *this)
spi = child_sa->get_spi(child_sa, TRUE);
child_cfg = child_sa->get_config(child_sa);
child_cfg->get_ref(child_cfg);
args.reqid = child_sa->get_reqid(child_sa);
args.reqid = child_sa->get_reqid_ref(child_sa);
args.label = child_sa->get_label(child_sa);
if (args.label)
{
@@ -391,6 +391,10 @@ static status_t destroy_and_reestablish(private_child_delete_t *this)
}
}
child_cfg->destroy(child_cfg);
if (args.reqid)
{
charon->kernel->release_reqid(charon->kernel, args.reqid);
}
DESTROY_IF(args.label);
if (status != SUCCESS)
{