core: ltc: SM2 DSA: fix bignum memory leaks

crypto_acipher_sm2_dsa_sign() and crypto_acipher_sm2_dsa_verify() leak
some bignum memory due to missing calls to ecc_free().
This is all the more problematic that bignum allocations use a special
memory pool [1] that can easily cause deadlocks when misused.

This commit adds the missing calls.

[1] Commit a2eb5b55d169 ("libutils: add mempool API")

Fixes: 76c7ba4b9ff7 ("core: ltc: add support for SM2 DSA")
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/core/lib/libtomcrypt/sm2-dsa.c b/core/lib/libtomcrypt/sm2-dsa.c
index 98dee08..47c9967 100644
--- a/core/lib/libtomcrypt/sm2-dsa.c
+++ b/core/lib/libtomcrypt/sm2-dsa.c
@@ -125,6 +125,7 @@
 	mp_to_unsigned_bin(s, sig + 32);
 	*sig_len = 64;
 out:
+	ecc_free(&ltc_key);
 	ltc_ecc_del_point(x1y1p);
 	mp_clear_multi(k, e, r, s, tmp, NULL);
 	return res;
@@ -241,6 +242,7 @@
 out:
 	mp_montgomery_free(mp);
 	ltc_ecc_del_point(x1y1p);
+	ecc_free(&ltc_key);
 	mp_clear_multi(rprime, sprime, t, mu, ma, eprime, R, NULL);
 	return res;
 }