Free the error_value of the global context before raise an error. (#2067)

JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu
This commit is contained in:
Marko Fabo
2017-10-31 15:47:20 +01:00
committed by László Langó
parent 5bd72047cc
commit 678fcb20ed
2 changed files with 17 additions and 0 deletions
+2
View File
@@ -19,6 +19,7 @@
#include "ecma-literal-storage.h"
#include "js-parser-internal.h"
#include "lit-char-helpers.h"
#include "jcontext.h"
#ifndef JERRY_DISABLE_JS_PARSER
@@ -2038,6 +2039,7 @@ lexer_construct_regexp_object (parser_context_t *context_p, /**< context */
if (is_throw)
{
ecma_free_value (JERRY_CONTEXT (error_value));
parser_raise_error (context_p, PARSER_ERR_INVALID_REGEXP);
}