This patch moves memory allocation for tc_actions to tcf_action_init_1 and fixes multiple bugs in error paths: - when memory allocation fails in tcf_action_init, the action is destroyed twice, once in tcf_action_init and once in tcf_action_add/tcf_change_act - when tcf_action_init_1 fails for the first action, the action is passed to tcf_action_destroy in an undefined state by tcf_action_add/tcf_change_act/tcf_change_act_police - when tcf_action_init_1 fails for any but the first action, the action leaks in tcf_action_init Regards Patrick