mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
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>
This commit is contained in:
committed by
Andreas Schneider
parent
059b6851dc
commit
13c88a2e0a
@@ -150,6 +150,7 @@ int ssh_mbedcry_rand_range(bignum dest, bignum max)
|
|||||||
}
|
}
|
||||||
rc = bignum_rand(rnd, bits);
|
rc = bignum_rand(rnd, bits);
|
||||||
if (rc != 1) {
|
if (rc != 1) {
|
||||||
|
bignum_safe_free(rnd);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
mbedtls_mpi_mod_mpi(dest, rnd, max);
|
mbedtls_mpi_mod_mpi(dest, rnd, max);
|
||||||
|
|||||||
Reference in New Issue
Block a user