Avoid using ast_strdupa() in a loop.