aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2019-12-16 16:48:40 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-12-23 14:31:32 +0100
commit13c88a2e0a7a894f23be0a12a5b75876d8e24f21 (patch)
tree1c6d020cd768e4db412211282d8910bbf29b3acd /src
parent059b6851dc0d42ab6bb9dbf7134ce4c30c52ce1f (diff)
downloadlibssh-13c88a2e0a7a894f23be0a12a5b75876d8e24f21.tar.gz
libssh-13c88a2e0a7a894f23be0a12a5b75876d8e24f21.tar.xz
libssh-13c88a2e0a7a894f23be0a12a5b75876d8e24f21.zip
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>
Diffstat (limited to 'src')
-rw-r--r--src/mbedcrypto_missing.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mbedcrypto_missing.c b/src/mbedcrypto_missing.c
index 5e9da6c5..cf789b13 100644
--- a/src/mbedcrypto_missing.c
+++ b/src/mbedcrypto_missing.c
@@ -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);