From: Gabríel Arthúr Pétursson Date: Wed, 3 Jan 2024 16:20:04 +0000 (+0000) Subject: cryptsetup: Fix memory leak when iterating over systemd-tpm2 tokens X-Git-Tag: v256-rc1~936^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a67075007cceb28586d878919649dce08ba226b;p=thirdparty%2Fsystemd.git cryptsetup: Fix memory leak when iterating over systemd-tpm2 tokens --- diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 0840a71548b..1a027300371 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -1724,7 +1724,6 @@ static int attach_luks_or_plain_or_bitlk_by_tpm2( } if (r == -EOPNOTSUPP) { /* Plugin not available, let's process TPM2 stuff right here instead */ - _cleanup_(iovec_done) struct iovec blob = {}, policy_hash = {}; bool found_some = false; int token = 0; /* first token to look at */ @@ -1734,6 +1733,7 @@ static int attach_luks_or_plain_or_bitlk_by_tpm2( for (;;) { _cleanup_(iovec_done) struct iovec pubkey = {}, salt = {}, srk = {}, pcrlock_nv = {}; + _cleanup_(iovec_done) struct iovec blob = {}, policy_hash = {}; uint32_t hash_pcr_mask, pubkey_pcr_mask; uint16_t pcr_bank, primary_alg; TPM2Flags tpm2_flags;