core: Fix memory leaks in sm2 of Mbedtls lib

When enable mbedtls in optee-os , xtest run twice will be fail.
Memory leakage exists in three functions.
1. grp and mpi in sm2_mbedtls_pke_encrypt
2. grp in sm2_mbedtls_dsa_sign
3. grp in sm2_mbedtls_dsa_verify

Fixes: c84eee6397bb ("core: add support for SM2 using MBed TLS")
Reviewed-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: lubing <lubing@eswin.com>
[jf: cherry-pick commit c04a96a45ffe from master]
Signed-off-by: Jerome Forissier <jerome@forissier.org>
2 files changed
tree: e7e4dbdf7423b182e38d3cd8adcbb6f24556a55a
  1. .github/
  2. core/
  3. keys/
  4. ldelf/
  5. lib/
  6. mk/
  7. scripts/
  8. ta/
  9. .checkpatch.conf
  10. .gitattributes
  11. .gitignore
  12. .shippable.yml
  13. .travis.yml
  14. CHANGELOG.md
  15. LICENSE
  16. MAINTAINERS
  17. Makefile
  18. README.md
  19. typedefs.checkpatch
README.md

OP-TEE Trusted OS

This git contains source code for the secure side implementation of OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io.

// OP-TEE core maintainers