1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-12 15:41:16 +03:00

bignum: Make bignum_free safer

Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Aris Adamantiadis
2016-01-01 19:16:49 +01:00
committed by Andreas Schneider
parent c3dac948c9
commit db9da99a36
9 changed files with 51 additions and 41 deletions

View File

@@ -72,7 +72,7 @@ char *ssh_gcry_bn2dec(bignum bn) {
num = bignum_new();
if (num == NULL) {
SAFE_FREE(ret);
bignum_free(ten);
bignum_safe_free(ten);
return NULL;
}
@@ -91,9 +91,9 @@ char *ssh_gcry_bn2dec(bignum bn) {
ret[count2] = ret[count2 + count];
}
ret[count2] = 0;
bignum_free(num);
bignum_free(bndup);
bignum_free(ten);
bignum_safe_free(num);
bignum_safe_free(bndup);
bignum_safe_free(ten);
}
return ret;