mbedcrypto_missing: Avoid potential memory leaks as reported by csbuild

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 13c88a2e0a)
This commit is contained in:
Jakub Jelen
2019-12-16 16:48:40 +01:00
committed by Andreas Schneider
parent 62f7004d5a
commit 46105f4aa6

View File

@@ -149,7 +149,8 @@ int ssh_mbedcry_rand_range(bignum dest, bignum max)
return 0;
}
rc = bignum_rand(rnd, bits);
if (rc != 1){
if (rc != 1) {
bignum_safe_free(rnd);
return rc;
}
mbedtls_mpi_mod_mpi(dest, rnd, max);