Fix cleanup upon error in String.prototype.replace (#3301)

Fixes #3297

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2019-11-12 10:54:26 +01:00
committed by Zoltan Herczeg
parent 452c78182d
commit b16b400d5b
2 changed files with 16 additions and 1 deletions
@@ -623,7 +623,7 @@ ecma_builtin_string_prototype_object_replace (ecma_value_t this_value, /**< this
if (ECMA_IS_VALUE_ERROR (result))
{
ecma_stringbuilder_destroy (&replace_ctx.builder);
goto cleanup_search;
goto cleanup_replace;
}
ecma_string_t *const result_str_p = ecma_op_to_string (result);