diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-05-21 10:51:17 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-05-21 10:51:17 +0200 |
commit | cb5e59186392276e74a16f2fe3bac515e12e20e6 (patch) | |
tree | 318c3d425a63c44c13b61fd3db01963fe0ec7855 /lib | |
parent | e76aff69a545b43c53af58a23af07f707c63f4e7 (diff) | |
download | gnutls-cb5e59186392276e74a16f2fe3bac515e12e20e6.tar.gz |
corrected allocation check
Diffstat (limited to 'lib')
-rw-r--r-- | lib/verify-tofu.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/verify-tofu.c b/lib/verify-tofu.c index 1dd7c45395..0d4d0e59d8 100644 --- a/lib/verify-tofu.c +++ b/lib/verify-tofu.c @@ -422,12 +422,11 @@ static int pgp_crt_to_raw_pubkey(const gnutls_datum_t * cert, } rpubkey->data = gnutls_malloc(size); - if (rpubkey->data == NULL) - if (ret < 0 && ret != GNUTLS_E_SHORT_MEMORY_BUFFER) { - ret = GNUTLS_E_MEMORY_ERROR; - gnutls_assert(); - goto cleanup; - } + if (rpubkey->data == NULL) { + ret = GNUTLS_E_MEMORY_ERROR; + gnutls_assert(); + goto cleanup; + } ret = gnutls_pubkey_export(pubkey, GNUTLS_X509_FMT_DER, |