summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2018-11-13 05:07:01 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-11-13 05:07:01 +0000
commit7e73fb75989719299a7fdc67488457dd175f2012 (patch)
tree59cf1db86debd880c2cf7e9edf441fdef5f3b94d /lib
parent868a373f915f65259c9708023ed612beb513db21 (diff)
parent610479fe408be9a3a714df8a650263fd7e0e36f0 (diff)
downloadgnutls-7e73fb75989719299a7fdc67488457dd175f2012.tar.gz
Merge branch 'tpm12_fix_memory_leak' into 'master'
tpm: Fix memory leak in encode_tpmkey_url See merge request gnutls/gnutls!800
Diffstat (limited to 'lib')
-rw-r--r--lib/tpm.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/tpm.c b/lib/tpm.c
index ee53c71540..95bed111af 100644
--- a/lib/tpm.c
+++ b/lib/tpm.c
@@ -839,16 +839,11 @@ static int randomize_uuid(TSS_UUID * uuid)
static int encode_tpmkey_url(char **url, const TSS_UUID * uuid,
TSS_FLAG storage)
{
- size_t size = (UUID_SIZE * 2 + 4) * 2 + 32;
uint8_t u1[UUID_SIZE];
gnutls_buffer_st buf;
gnutls_datum_t dret;
int ret;
- *url = gnutls_malloc(size);
- if (*url == NULL)
- return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
-
_gnutls_buffer_init(&buf);
memcpy(u1, &uuid->ulTimeLow, 4);