Fix invalid free in ecma_op_function_get_super_constructor (#3644)

This patch fixes #3636.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-03-27 11:28:23 +01:00
committed by GitHub
parent 76b8555210
commit 2ed742a9e7
2 changed files with 43 additions and 1 deletions
@@ -681,7 +681,10 @@ ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p) /**< function
if (super_ctor_p == NULL || !ecma_object_is_constructor (super_ctor_p))
{
ecma_deref_object (super_ctor_p);
if (super_ctor_p != NULL)
{
ecma_deref_object (super_ctor_p);
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Super binding must be a constructor."));
}