Fix double literal free. (#2535)

Fixes #2531.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2018-10-18 01:17:53 +02:00
committed by Akos Kiss
parent 3afc4b0b85
commit 5060579b90
3 changed files with 43 additions and 2 deletions
+2
View File
@@ -204,6 +204,8 @@ parser_compute_indicies (parser_context_t *context_p, /**< context */
if (!(literal_p->status_flags & LEXER_FLAG_SOURCE_PTR))
{
jmem_heap_free_block ((void *) char_p, literal_p->prop.length);
/* This literal should not be freed even if an error is encountered later. */
literal_p->status_flags |= LEXER_FLAG_SOURCE_PTR;
}
}
}