Actions
Bug #3983
openosmo_fsm_inst_change_parent() forgets to talloc reparent
Status:
New
Priority:
Normal
Assignee:
-
Category:
libosmocore
Target version:
-
Start date:
05/07/2019
Due date:
% Done:
0%
Spec Reference:
Description
osmo_fsm_inst_alloc_child() specifically allocates the child FSM instance as a talloc child of the parent FSM instance.
However, osmo_fsm_inst_change_parent() fails to move the child FSM instance to belong to the new parent FI's talloc context.
A distinct talloc_steal() is necessary to fix the situation, for example in osmo-msc:
osmo_fsm_inst_change_parent(cl->fi, new_parent_fi, parent_event_term); talloc_steal(new_parent_fi, cl->fi);
When fixing this, we need to consider previous users of libosmocore and compatibility,
so we probably need an osmo_fsm_inst_change_parent2() which also reparents, and deprecate but keep unchanged the current osmo_fsm_inst_change_parent() function.
Actions