BUGFIX: memleaks in stri_sub_replacement