summaryrefslogtreecommitdiff
path: root/lib/verify-tofu.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-05-21 10:51:17 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-05-21 10:51:17 +0200
commitcb5e59186392276e74a16f2fe3bac515e12e20e6 (patch)
tree318c3d425a63c44c13b61fd3db01963fe0ec7855 /lib/verify-tofu.c
parente76aff69a545b43c53af58a23af07f707c63f4e7 (diff)
downloadgnutls-cb5e59186392276e74a16f2fe3bac515e12e20e6.tar.gz
corrected allocation check
Diffstat (limited to 'lib/verify-tofu.c')
-rw-r--r--lib/verify-tofu.c11
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,