Remove unneeded string copy via malloc