add exec_template() RainerScript function
fix invalid free introduced by exec_template()