core: ta_open(): free allocated memory on error
core: ta_open(): free allocated memory on error

In error condition on checking "ta_size", was returning
error from function without cleaning allocated memory.

Signed-off-by: Sahil Malhotra <bc8c689da66bcf78557149af9d21aafe87699754@nxp.com>
Reviewed-by: Jens Wiklander <7706914404370d7502c27a0eff493dcf491feb51@linaro.org>
Fixes: https://github.com/OP-TEE/optee_os/pull/2776
[jf: minor edits to commit message]
Signed-off-by: Jerome Forissier <ced78d268b4c9a0a20a59a9feeebd2ad90da03d3@linaro.org>

pascal-brand-st-dev/optee_os,pascal-brand-st-dev/optee_os,pascal-brand-st-dev/optee_os,pascal-brand-st-dev/optee_os,pascal-brand-st-dev/optee_os