diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-11-07 12:08:03 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-11-07 12:08:03 +0000 |
commit | 5881a6e5ff317177e1a8d636c2125fb0172d0310 (patch) | |
tree | e927d0806adf4c41353665df96d5030225471e6a /lib/gnutls_cert.c | |
parent | 705bed9d7ba3cb8c84682cd157b73595d1b1217b (diff) | |
download | gnutls-5881a6e5ff317177e1a8d636c2125fb0172d0310.tar.gz |
corrected memory leaks and other bugs
Diffstat (limited to 'lib/gnutls_cert.c')
-rw-r--r-- | lib/gnutls_cert.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c index 1825ea017e..0830152bd8 100644 --- a/lib/gnutls_cert.c +++ b/lib/gnutls_cert.c @@ -479,8 +479,12 @@ static int _read_rsa_params(opaque * der, int dersize, MPI ** params) /* allocate size for the parameters (2) */ *params = gnutls_calloc(1, 2 * sizeof(MPI)); + if (*params==NULL) { + gnutls_assert(); + return GNUTLS_E_MEMORY_ERROR; + } - if (gcry_mpi_scan(&(*params)[0], GCRYMPI_FMT_USG, str, &len) != 0) { + if (_gnutls_mpi_scan(&(*params)[0], GCRYMPI_FMT_USG, str, &len) != 0) { gnutls_assert(); gnutls_free((*params)); asn1_delete_structure(spk); @@ -500,7 +504,7 @@ static int _read_rsa_params(opaque * der, int dersize, MPI ** params) } - if (gcry_mpi_scan(&(*params)[1], GCRYMPI_FMT_USG, str, &len) != 0) { + if (_gnutls_mpi_scan(&(*params)[1], GCRYMPI_FMT_USG, str, &len) != 0) { gnutls_assert(); _gnutls_mpi_release(&(*params)[0]); gnutls_free((*params)); |